Skip to content

crit push silently drops local body edits to already-pushed comments #446

@tomasz-tomczyk

Description

@tomasz-tomczyk

Summary

When a user edits the body of a comment that was already pushed to GitHub (i.e. has a non-zero github_id), the next crit push is a no-op (No comments to push.) and the remote body stays at its original value. The edit is silently dropped.

Reproducer

TestRoundtrip_EditPushedCommentBody in roundtrip_integration_test.go (e2e_github tag):

  1. crit comment sample.go:19 'original body'
  2. crit push → remote ID assigned, count=1
  3. Edit the review file: change body from original body to edited body
  4. crit push → output is No comments to push.; remote still has original body

Expected

GitHub's review-comment API supports PATCH repos/{owner}/{repo}/pulls/comments/{id}. Push should issue PATCH for comments whose local body diverges from the last-known remote body. Remote count stays 1, remote ID unchanged, remote body matches local.

Actual failure output

=== RUN   TestRoundtrip_EditPushedCommentBody
    roundtrip_integration_test.go:445: push #2 output:
        No comments to push.
    roundtrip_integration_test.go:455: remote body did not update: got "original body", want "edited body"
--- FAIL: TestRoundtrip_EditPushedCommentBody (11.46s)

Notes

  • This is the literal "comments getting recreated whole" / "edits don't propagate" symptom from earlier reports.
  • Distinct from crit push doesn't post replies to imported remote comments #442 (which covers push skipping replies whose parent has any GitHubID).
  • The PASS-shape of this test would also accept a no-op-with-warning; what fails it is the body never reaching GitHub.

Test is being skipped with t.Skip("blocked on issue #N: ...") pending a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions