fix(sync): send LastSeenServerSeq from CLI push, report conflicts

This commit is contained in:
mirivlad 2026-06-02 08:02:07 +08:00
parent 3c7e9d1d56
commit 852d6d373c
1 changed files with 8 additions and 0 deletions

View File

@ -672,6 +672,11 @@ func runSyncPush(args []string) {
return
}
_, _, lastSeq, _, _ := syncSvc.GetState()
for i := range unpushed {
unpushed[i].LastSeenServerSeq = lastSeq
}
result, err := client.Push(unpushed)
if err != nil {
fmt.Fprintf(os.Stderr, "Push failed: %v\n", err)
@ -684,6 +689,9 @@ func runSyncPush(args []string) {
}
fmt.Printf("Pushed %d ops, accepted %d\n", len(unpushed), len(result.Accepted))
if len(result.Conflicts) > 0 {
fmt.Printf("WARNING: %d conflict(s) detected\n", len(result.Conflicts))
}
}
func runSyncPull(args []string) {