fix: propagate local comment deletes to GitHub on push#461
Merged
tomasz-tomczyk merged 1 commit intomainfrom May 5, 2026
Merged
fix: propagate local comment deletes to GitHub on push#461tomasz-tomczyk merged 1 commit intomainfrom
tomasz-tomczyk merged 1 commit intomainfrom
Conversation
Closes #449 When a comment with GitHubID != 0 is deleted locally, append its GitHubID to a top-level pending_github_deletes list. crit push drains this list by issuing DELETE for each ID; pull's merge filters upstream comments whose ID is pending so they aren't resurrected before push runs. Replies use the same mechanism — GitHub treats them as comments on the same /pulls/comments/{id} endpoint, so one list covers both. omitempty on the slice ensures a fully-drained list disappears from review.json entirely; agents reading the file directly never see a stale empty array or per-record tombstone fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (76.27%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #461 +/- ##
==========================================
+ Coverage 68.94% 69.13% +0.18%
==========================================
Files 36 36
Lines 10401 10546 +145
==========================================
+ Hits 7171 7291 +120
- Misses 2680 2695 +15
- Partials 550 560 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Closes #449.
When a comment with
GitHubID != 0is deleted locally, append its GitHubID to a top-levelpending_github_deleteslist.crit pushdrains this list by issuing DELETE for each ID;crit pull's merge filters upstream comments whose ID is pending so they aren't resurrected before push runs.Replies use the same mechanism — GitHub treats them as comments on the same
/pulls/comments/{id}endpoint, so one list covers both.omitemptyon the slice ensures a fully-drained list disappears fromreview.jsonentirely; agents reading the file directly never see a stale empty array or per-record tombstone fields.Race fix included
The daemon (long-lived process) and
crit push(separate CLI invocation) both own a copy of the queue. The daemon's in-memory snapshot used to clobber disk on the next debounced write, resurrecting IDs that push had just drained. Reconciliation inbuildCritJSONnow treats disk as authoritative for the queue: in-memory IDs that vanished from disk (push drained them) are dropped from the snapshot; freshly-queued local deletes are preserved.Exit-code fix included
Per-ID DELETE failures no longer fail the whole push when posts/patches succeeded. Exit 1 only when nothing succeeded AND something failed. Failed deletes stay in the queue for next-push retry.
Review
Test plan
🤖 Generated with Claude Code