fix(comments): continue sparse comment updates before stopping#61
Conversation
📝 WalkthroughWalkthroughThis PR extends the comments store to track and handle sparse comment follow-up updates. When a comment update lacks ChangesSparse comment follow-up tracking
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Addressed the valid Cursor Bugbot finding in The store now clears pending sparse-follow-up bookkeeping whenever it intentionally stops a live comment, so a stopped in-flight sparse follow-up cannot suppress the next update cycle. Added regression coverage for both unsubscribe/stop and refresh-while-a-follow-up-is-pending paths; those two tests fail against the previous PR commit and pass with the fix. Verification run after the change:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 359f7d0. Configure here.
|
Addressed the remaining valid Cursor Bugbot finding about sparse follow-up update rejections. What changed:
Evidence:
Verification:
|

Summary
Verification
yarn buildyarn testyarn test:coverageyarn lintexits 0 with existing warningsnode scripts/verify-hooks-stores-coverage.mjsstill reports existing hook/store coverage gaps outside this fix; the new sparse follow-up cleanup path is coveredNotes
The regression tests fail without the source fix because sparse CID-only comments receive only one
update()call, then pass with the fix because the mutable follow-up runs before stopping.Note
Medium Risk
Changes comment lifecycle timing (when live comments stop and when refresh resolves), which can affect reply/thread display; scope is limited to the comments store with broad regression tests.
Overview
Fixes CID-only comments that finish their first
update()with only immutable IPFS fields (timestampwithoutupdatedAt) and were stopped too early, so mutable thread data (e.g.replyCount,replies) never loaded.The comments store now tracks a one-shot sparse follow-up: after a successful update that still looks sparse, it triggers one more
update()when the comment is in one-shot load, auto-update, or refresh flows.refreshComment/waitForCommentUpdateCyclestay pending until that follow-up completes (or fails). Follow-up state is cleared on stop, reset, and update errors;comment.updaterejections now normalize errors, try to emit on the live comment, and record them in store errors instead of only tracing.Adds a
createSparseCommenttest helper and regression tests for add, auto-update, refresh, reject paths, and cleanup on reset/stop/refresh.Reviewed by Cursor Bugbot for commit 625f3e6. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Tests