fix(routing): open the pathway a legacy news link points at - #172
Merged
Conversation
86 links in this site's own news archive open the pathway browser with
nothing in it. They are the old browser's fragment links, and they come in
two spellings because the old site produced both:
#/R-HSA-1430728 770 links, work
#R-HSA-202733 41 links, blank page
#R-HSA-8853659.1 45 links, blank page
FRAGMENT_PATTERN required the leading slash. Without one nothing matched,
so no id was extracted and the browser opened on no pathway -- from a link
in a release announcement, which is where someone arrives from a citation.
The slash is now optional and the id is required, which is what keeps a
fragment that is not a pathway -- `#introduction`, naming a section to
scroll to -- falling through untouched instead of being read as a stale
route. A trailing stIdVersion is consumed and dropped: the content service
does not want it, and it used to arrive as a query parameter called ".1".
Verified on beta: all three previously blank forms now open their pathway,
and the two that already worked are unchanged, parameters included. The
test cases are taken from what is actually in the content rather than
invented, and fail against the old pattern -- bare id and version go red,
the four that already worked stay green.
Not covered: 37 links spelling `#TOOL=AT`, the old analysis tool fragment.
They fall through as before rather than opening anything, and where they
should land is a product decision rather than a regex.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
86 links in this site's own news archive open the pathway browser with nothing in it.
They are the old browser's fragment links, and they come in two spellings because the old site produced both:
#/R-HSA-1430728#R-HSA-202733#R-HSA-8853659.1FRAGMENT_PATTERNrequired the leading slash:Without a slash there is no match at all, so no id is extracted and the browser opens on no pathway — from a link in a release announcement, which is exactly where someone arrives from a citation.
The fix
The slash is optional and the id is required. Requiring the id is what keeps a fragment that is not a pathway —
#introduction, naming a section to scroll to — falling through untouched instead of being read as a stale route.A trailing stIdVersion is consumed and dropped: the content service does not want it, and it used to arrive as a query parameter literally named
.1.Verified on beta
#R-HSA-913531#R-HSA-202733#R-HSA-8853659.1#/R-HSA-447115#/R-HSA-8876384&PATH=…pathpreservedThe test cases are taken from what is actually in the content rather than invented, and they fail against the old pattern: bare id and version go red, the four that already worked stay green.
Not covered
37 links spell
#TOOL=AT, the old analysis-tool fragment. They fall through as before rather than opening anything. Where they should land is a product decision rather than a regex — happy to wire it up once someone says where.