Skip to content

fix: a new finding on a line that already carries a comment is no longer dropped as a resend - #114

Merged
fiddur merged 2 commits into
developfrom
fix/review-dedup-by-finding
Sep 11, 2026
Merged

fiddur merged 2 commits into
developfrom
fix/review-dedup-by-finding

Conversation

@fiddur

@fiddur fiddur commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Posting a review dropped two findings as "already on the PR". They were not: the lines carried older comments, resolved in an earlier round.

isAlreadyCommented matched on path, line and side alone, against every inline comment on the pull request from anyone. So any comment sitting on a line made a new finding there look like a resend, and createReview counted it in skipped and said nothing.

What changed

  • Identity decides it. comment_threads.submitted_at already records what diffity sent, and the page has been reading it to mark a row already on the pull request — the submit path was the one still guessing. A finding that went out once is still held back however it reads now, since the forge cannot update the comment already there.
  • Position is the fallback only, for a finding with no local record (imported from a bundle, posted from another machine), and narrowed: same wording, same place, same account. getComments therefore returns login.
  • The inbox's auto-post path gets the same treatment via viewerLogin.

Tests

  • comment-targets.test.ts — the reported case, the reworded resend, another reviewer's identical wording, CRLF.
  • create-review-dedup.test.ts (new) — end to end through /api/github/create-review with a gh that reports what is already on the pull request and keeps the review it is handed, so the assertions are about what actually went out. Two of its cases fail on the old code.

0.10.36.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w

fiddur and others added 2 commits September 11, 2026 13:37
…ger dropped as a resend

Whether a finding is already on the pull request was decided by its position: path, line
and side, ignoring the wording. A line collects comments over rounds, so an earlier remark
there — resolved, or another reviewer's — silently swallowed any new finding on that line.
Two findings vanished that way.

Identity decides it now. `comment_threads.submitted_at` already records what diffity sent,
and the page has been reading it all along to mark a row *already on the pull request*; the
submit path was the one still guessing from position. Where there is no local record — a
finding imported from a bundle, or posted from another machine — the same wording in the
same place from the same account is the evidence left, so the author's login now comes back
with the existing comments.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
… already

Self-review found the record too narrow. Pulling comments records the forge comment a
thread exists as, in `github_comment_id`, and never sets `submitted_at` — so a pulled
comment, which the dialog offers like any other, would have gone back out as a second copy
once edited locally or shifted by a new head. The old position rule hid that.

`threadsOnTheForge` answers what the name says now: sent from here, or pulled from there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
@fiddur
fiddur marked this pull request as ready for review September 11, 2026 12:06
@fiddur
fiddur merged commit 9cecbb1 into develop Sep 11, 2026
2 checks passed
@fiddur
fiddur deleted the fix/review-dedup-by-finding branch September 11, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant