You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internalLinks [nfc]: Fix bug in getMessageIdFromLink
There were two things wrong here:
- `url.includes('near')` was a pretty poor heuristic to decide if
the narrow link has a "near" operator. It would give false
positives if "near" appeared somewhere other than the
operator-operand pair "/near/{message_id}", e.g., if it appeared
in the realm's base URL (if `url` is an absolute URL string), or a
stream or topic name in an operand.
- Once we (unsoundly) decided that there was a "near" operator, we'd
try to locate it in hashSegments by searching *all* of
hashSegments, including ones that represent operands. This could
be thrown off by an operand with the value "near", as in
`topic/near`.
NFC because we always drop the result of this function on the floor,
after passing it to doNarrow. But we need this to start giving the
right answer, for zulip#5306, "Follow /near/ links through topic
moves/renames".
0 commit comments