Skip to content

[Medium] Retry after a partial suggestion failure posts the same edit twice (unstable suggestion cid) #308

Closed

Description

@nownabe

Overview

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.

Context

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.

References

Implementation ideas

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

  1. self-assigned this
    on Sep 20, 2026
  2. added
    bug
    on Sep 20, 2026
  3. added 3 commits that reference this issue on Sep 20, 2026
    963339d
    9465718
    bda2582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions