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
[Medium] Retry after a partial suggestion failure posts the same edit twice (unstable suggestion cid) #308
suggestionsToDrafts() in entrypoints/review/App.tsx mints a fresh cid for every suggestion-derived comment on every Submit. After a partial failure, PR #307 keeps the reviewer's persisted edits (so the work is not lost), but a retry now materialises a second draft for the same edit while the first, failed draft is still parked in LocalState. Both get posted on the retry: two comments for one suggestion.
Goal
Retrying a Submit after a suggestion-derived comment failed posts exactly one comment per edited hunk.
Root cause: the suggestion → draft materialisation has no stable identity. The cid must be a function of the edit (path + base sha + hunk position/content), or the parked failed draft must be reused instead of re-deriving.
Expected Impact
No duplicate suggestion comments on GitHub after a transient failure.
Acceptance Criteria
A suggestion-derived draft has a cid stable across Submits for the same hunk (or suggestionsToDrafts skips hunks that already have a parked draft with lastError).
Test: transport fails once, then succeeds; exactly one comment is created for the hunk.
Derive the cid deterministically (hash of path + baseSha + hunk range + replacement), so re-materialisation upserts the same Comment.
Note: These are preliminary thoughts at issue creation time and have not been thoroughly considered from an implementation perspective. During design, revisit the goal and re-evaluate the approach from scratch.
Activity
fix(review): derive a suggestion draft's cid from the hunk it materia…
fix(review): map comment positions between head and edited coordinates (
docs: correct design doc, ADR and spec statements that no longer hold (…