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
{{ message }}
Repository navigation
Unposted review annotations become unreachable when the diff changes (draft is keyed by whole-patch hash) #1590
Review annotations are persisted under contentHash(options.rawPatch) in packages/server/review.ts. Any change to the diff changes the key, and the previous draft is simply not looked up any more.
For a PR review that means: annotate a PR, close the session, a teammate pushes a commit, reopen the PR → every unsubmitted comment is gone from the UI. The draft file is still on disk under the old hash; it has only become unreachable.
GitHub keeps pending review comments across pushes and marks them "Outdated". This is a place where Plannotator loses work that the web UI would keep.
This looks like the same mechanism as #1136, which covers viewed-file state. The acceptance criteria there are written around viewed marks, so it may be worth confirming that the fix also carries the annotation draft, which rides the same key.
Reproduction (0.27.17, macOS)
In any git repo with an uncommitted change, run plannotator review.
Add an inline comment on the changed file. Close the tab without submitting.
A new file appears in ~/.plannotator/drafts/<hash>.json and contains the comment.
Make one more edit to the same file so the diff changes.
Run plannotator review again.
Expected: the comment from step 2 is shown, possibly marked outdated.
Actual:GET /api/draft returns {"found": false}, the UI shows no annotations, and the file from step 3 is still on disk, untouched.
Restarting with an unchanged diff restores the draft correctly, so this is specifically about the key changing, not about persistence in general. Same outcome for a PR review when the branch receives a new commit between sessions.
Proposed behavior
Key the review draft by the review target rather than by patch content, the way #1112 did for Guided Reviews:
On load, anchor each annotation by file path plus line or hunk content. Annotations whose anchor no longer matches are shown as outdated rather than dropped.
Acceptance criteria
Reopening a PR review after new commits shows the previously saved, unsubmitted annotations.
Annotations on unchanged lines keep their position; annotations on changed lines are marked outdated, not lost.
Existing drafts stored under the content-hash key are migrated or remain discoverable.
Thanks @RobertoArtiles, this is a clear and well-specified report, and the reproduction is exact. Confirmed it is long-standing rather than new in 0.27.17: the draft has been keyed by the whole-patch hash since drafts existed. Your read of #1136 is right too, viewed state rides the same key, so the fix should carry both. Keying by review target with per-file anchoring, the way #1112 did for guides, is the shape I'd expect; the owner will weigh in on scheduling.
Activity
backnotprop commentedon Sep 22, 2026
Thanks @RobertoArtiles, this is a clear and well-specified report, and the reproduction is exact. Confirmed it is long-standing rather than new in 0.27.17: the draft has been keyed by the whole-patch hash since drafts existed. Your read of #1136 is right too, viewed state rides the same key, so the fix should carry both. Keying by review target with per-file anchoring, the way #1112 did for guides, is the shape I'd expect; the owner will weigh in on scheduling.
fix(review): address review of PR draft persistence (#1590)
fix(review): hold PR draft autosave while a switch merge offer is pen…
fix(review): auto-merge a switched-onto PR draft instead of holding a…
fix(review): bound and retry the switched-onto PR draft read (#1590)
fix(review): keep unsent PR review comments across new commits (#1590) (
Annotate drafts follow the file's path (0.29 PR 2) (#1710)
backnotprop commentedon Oct 21, 2026
Fixed in #1592.