Skip to content

[claude] Warn when a sync will leave a client's commits still differing - #157

Closed
myieye wants to merge 2 commits into
mainfrom
sync-logging
Closed

myieye wants to merge 2 commits into
mainfrom
sync-logging

Conversation

@myieye

@myieye myieye commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

[Claude, autonomous]

SyncService logs a warning when a sync will leave local and remote holding different commits from some client, i.e. one side withheld commits the other lacks.

  • This covers a case the server's divergence event (Trace sync planning and recovery #155) can't see: a device whose old commit never reached the server while it keeps pushing newer ones, so the server only ever looks "just behind".
  • It reaches support through FW Lite's log file and Honeycomb through fw-headless's exported logs.
  • Known gap: clients where either side resends its whole history are skipped, since the count/hash sums don't apply there.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@myieye
myieye added this pull request to stack #158 October 26, 2026 10:12
var localAfter = localClient.Plus(pulledState.GetClientState(localClient.ClientId));
var remoteAfter = remoteClient.Plus(pushedState.GetClientState(localClient.ClientId));
if (!localAfter.HasSameCommits(remoteAfter))
logger.LogWarning("Commits from client {ClientId} will still differ after this sync: local has {LocalCount} up to {LocalHead}, remote has {RemoteCount} up to {RemoteHead}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I care about this specifically, as much as I just want to know when the clients have the same timestamp but not the same hash.

Comment thread src/SIL.Harmony/SyncService.cs Outdated
Base automatically changed from crdt-sync-service to main October 27, 2026 06:59
myieye and others added 2 commits October 27, 2026 07:59
SyncService now logs a warning when, after this sync, local and remote
will still hold different commits from some client: a side withheld
commits the other lacks. This catches a case the server can't see, such
as a device whose old commit never reached the server while it keeps
pushing newer ones, so the server only ever looks "just behind".

It compares count and XOR hash of local + pulled against remote + pushed,
using commits already in memory, and skips clients where a side sends
its whole history, since that resends commits the other side has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye myieye closed this Oct 28, 2026
@myieye
myieye removed this pull request from stack #158 October 28, 2026 05:48
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