fix(api,cli): self-heal duplicate managed comments; re-sync after meta set#471
Merged
Zach Dunn (zachdunn) merged 1 commit intoJul 23, 2026
Merged
Conversation
…meta set - upsertBotComment now collects every namespaced marker comment during the hunt, patches the oldest, and deletes the extras best-effort, so a webhook vs CLI create race no longer leaves a permanently stale duplicate - meta set on a gh/-keyed object that touches path/state triggers a best-effort bot comment refresh, degrading to a stderr hint Closes #470
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-api | 47da706 | Commit Preview URL Branch Preview URL |
Jul 23 2026, 05:21 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-auth | 47da706 | Commit Preview URL Branch Preview URL |
Jul 23 2026, 05:21 PM |
Zach Dunn (zachdunn)
deleted the
claude/duplicate-bot-comments-meta-sync-bcb61c
branch
July 23, 2026 17:29
This was referenced Jul 23, 2026
This was referenced Jul 23, 2026
Merged
Merged
This was referenced Jul 23, 2026
Zach Dunn (zachdunn)
added a commit
that referenced
this pull request
Jul 23, 2026
) * fix(comment): dedupe duplicate managed comments on explicit resync PR #471's self-healing dedupe only runs on the marker hunt, and `upsertBotComment`'s fast path PATCHes the KV-cached comment id with no listing — so while the cache is warm (30 days) a race-created duplicate sat untouched until a cache miss forced a hunt. Add `forceHunt` to `upsertBotComment` and plumb it through `postManagedComment` (`resync`), the `/github/comment` route body, the CLI client, and `syncAttachmentsComment`. The explicit resync callers — `uploads comment`, both `comment` MCP tools, and the `meta set` refresh — now pay one listing so a duplicate's lifetime is bounded by the next explicit resync. Attach/screenshot/promote syncs keep the fast path. Closes #480 * chore(impeccable): extend the broken-image waiver to the hosted MCP worker PR #477 scoped the broken-image waiver to `packages/uploads/src/**`, which never covered `apps/mcp/src/**` — so the hosted MCP worker kept reporting the `<img width=…>` prose in its `put` tool-schema description. apps/mcp/src is a headless JSON-RPC worker with no rendered surface; the only `<img` in it is documentation of the markdown the tool emits. Same class as the CLI, so it belongs on the existing entry rather than a second one. Verified: detect reports nothing with the config and the finding returns under --no-config, with the original glob still suppressing. * chore(impeccable): waive broken-image by class instead of per-directory Two rounds of per-directory patching left 11 latent findings that would surface on unrelated edits: apps/api/src (7 comment-markdown builders) and apps/web/src/lib (4, one an XSS test fixture that must stay malformed). Waive the class the rule can't distinguish — code that EMITS markup as strings, plus test fixtures — rather than disabling broken-image globally. It stays live on apps/web/src/components/**, apps/web/src/pages/**, and packages/ui/**, which scan clean today and are where a real broken image would actually ship. Verified: those four areas report zero with the config, and a planted <img src=""> in a component, a page, and a UI package is still reported.
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.
Closes #470.
What
1. Self-healing dedupe of the managed bot comment (server).
upsertBotComment's marker hunt now collects every comment carrying the workspace's namespaced marker instead of stopping at the first. The oldest is kept and PATCHed; extras are DELETEd best-effort (a failed delete never fails the caller — the next sync retries). This makes the webhook-vs-CLI create race that duplicated the comment on PR #468 retroactively harmless: the next sync on an affected thread collapses the duplicates. Legacy (unnamespaced) marker comments are only ever adopted, never deleted, since they may belong to another workspace.2.
meta setrefreshes the comment (CLI).uploads meta seton agh/…-keyed object that touches a rendered key (path/state, per #370) now triggers a best-effort bot comment refresh; if the endpoint is unavailable it prints atip: run uploads comment --pr Nstderr hint instead of failing the metadata write. Untouched for non-gh keys and non-rendered keys.Notes
set_metadatahas the same re-sync gap; left for the Hosted MCP: comment parity for put (pr/issue targeting + managed comment sync) #392 comment-parity work.apps/api/src/github-comment.test.tsandpackages/uploads/test/commands-meta.test.ts; full suite (2842 tests) and typecheck pass.