Skip to content

History Comment Sync API#6017

Merged
ChrisPenner merged 46 commits intotrunkfrom
cp/comments-sync-api
Jan 16, 2026
Merged

History Comment Sync API#6017
ChrisPenner merged 46 commits intotrunkfrom
cp/comments-sync-api

Conversation

@ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Nov 21, 2025

Overview

  • Adds comment syncing to the push process

Implementation approach and notes

  • Uses websockets bi-directional channel interactive sync process
  • Adds a lot of websocket utilities which are also useful to SyncV3 :)
  • UCM scans the full causal history and collects comment hashes, sends them to the server, the server reports back which hashes its missing, which UCM then uploads.

Interesting/controversial decisions

The algorithm here is pretty naive, the "correct" way to sync something like this is to make comments part of the main causal merkle-tree (and affect hashing); but a redo of code hashing is out-of-scope;

There are smarter ways to do this sync even without integrating comments into the history;
one particular option would be to tag each branch with not just its causal root, but also the root of a Merkle Search Tree which contains all the comments it knows about which are reachable from that causal root. MSTs are a useful data type for efficiently doing unions of arbitrary sets across distributed clients like this.

Since most cases are likely to be small here, we'll ship with this simple version in the hopes it lasts us for a while, and we can integrate the more complex and efficient version later.

Comment sync is quite likely to be dwarfed by code-sync in the majority of cases.

Test coverage

  • Manual testing
  • Transcripts on the Share side.

@mergify mergify bot mentioned this pull request Dec 19, 2025
3 tasks
@ChrisPenner ChrisPenner changed the base branch from cp/change-comments-sync to trunk December 19, 2025 16:14
@ChrisPenner ChrisPenner changed the base branch from trunk to cp/change-comments-sync December 19, 2025 16:14
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from 28e1af1 to 0af09bd Compare December 19, 2025 16:18
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from 0af09bd to de952d7 Compare January 5, 2026 21:20
@ChrisPenner ChrisPenner force-pushed the cp/comments-sync-api branch 2 times, most recently from aabc594 to 932e0ff Compare January 5, 2026 21:54
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from 258064e to 6f4d4ac Compare January 6, 2026 18:40
@ChrisPenner ChrisPenner force-pushed the cp/comments-sync-api branch 2 times, most recently from 54d4d21 to a6c72a3 Compare January 6, 2026 23:58
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from abdb970 to 9b4a76e Compare January 7, 2026 00:08
@ChrisPenner ChrisPenner force-pushed the cp/comments-sync-api branch 2 times, most recently from bf48d60 to 3297edd Compare January 8, 2026 20:17
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from f4e6821 to 4966a7b Compare January 15, 2026 20:52
@ChrisPenner ChrisPenner force-pushed the cp/comments-sync-api branch 3 times, most recently from f4822cc to 2233f12 Compare January 15, 2026 21:14
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from 0b397a9 to cb0e671 Compare January 15, 2026 21:16
@ChrisPenner ChrisPenner changed the base branch from cp/change-comments-sync to trunk January 15, 2026 22:43
@ChrisPenner ChrisPenner changed the base branch from trunk to cp/change-comments-sync January 15, 2026 22:44
@ChrisPenner ChrisPenner marked this pull request as ready for review January 15, 2026 22:52
@ChrisPenner ChrisPenner requested a review from aryairani January 15, 2026 22:59
@ChrisPenner ChrisPenner changed the base branch from cp/change-comments-sync to trunk January 15, 2026 23:06
@ChrisPenner ChrisPenner changed the base branch from trunk to cp/change-comments-sync January 15, 2026 23:06
@ChrisPenner ChrisPenner force-pushed the cp/change-comments-sync branch from cb0e671 to ef5feec Compare January 16, 2026 18:59
Base automatically changed from cp/change-comments-sync to trunk January 16, 2026 22:49
@ChrisPenner ChrisPenner merged commit 9aab7f7 into trunk Jan 16, 2026
8 of 18 checks passed
@ChrisPenner ChrisPenner deleted the cp/comments-sync-api branch January 16, 2026 22:49
@ChrisPenner
Copy link
Member Author

It looks like this was merged red, but it was merged as part of a later branch that made it green ✅

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.

2 participants