Fix comment permalinks with version query#573
Open
ion-lion wants to merge 2 commits into
Open
Conversation
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.
Summary
Fixes #572.
Comment permalink URLs can include
?v=<comment-version-cid>. On/:comments/<author>/<commentId>routes, web should treat thatvas the comment version, not as the target document version.This PR:
?vout of the target document lookup so the document resolves normallycommentVersiongetComment(commentVersion || openCommentId)Verification
Reproduced before patch:
063b70c39 fix(hmnet): import sqlite package for *sqlite.Stmt callbacksgit checkout --detach HEAD^ corepack pnpm --filter @shm/web test app/comment-permalink-route.test.ts?v=comment-version-cidas the document version:version: null,latest: trueversion: "comment-version-cid",latest: falseVerified after patch:
fix/comment-version-permalink/ae883eb1f Add comment permalink route regression testgit checkout fix/comment-version-permalink corepack pnpm --filter @shm/web test app/comment-permalink-route.test.tsAdditional checks:
corepack pnpm --filter @shm/web exec prettier --check app/comment-permalink-route.test.tsgit diff --checkLimitations:
corepack pnpm install --frozen-lockfilereached a lifecycle failure building@sentry/profiling-nodebecausemakeis missing in this environment. Enough JS dependencies were installed for the focused web Vitest target and Prettier check to run.Repro URL
Broken before this change:
https://seedteamtalks.hyper.media/discussions/high-network-usage-in-activity-monitor/:comments/z6MkwRWdU6HY11Qzi9SQZrwSx3rxFw94ipYyiN7Dtbrcg2yU/z6GeWHYXTLa49x?v=bafy2bzacedjrx7zih3zlgvwhlvkpe3lmcvoa67ikvfrvfdqvf2ge4ky6nomhm
Works without
?v:https://seedteamtalks.hyper.media/discussions/high-network-usage-in-activity-monitor/:comments/z6MkwRWdU6HY11Qzi9SQZrwSx3rxFw94ipYyiN7Dtbrcg2yU/z6GeWHYXTLa49x