collect: revert last_broadcast to snapshot, not payload

Diffs should always be computed against the last full snapshot,
not the last broadcast payload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 11:57:15 +02:00
co-authored by Claude Sonnet 4.6
parent 561c610b92
commit f9dd96269e
+1 -1
View File
@@ -93,7 +93,7 @@ def run(args: argparse.Namespace) -> None:
payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True) payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True)
else: else:
payload = snapshot payload = snapshot
last_broadcast = payload last_broadcast = snapshot
network.broadcast(payload, push_clients, push_lock) network.broadcast(payload, push_clients, push_lock)
log.info("Record #%d saved at %s", len(store["records"]), snapshot["ts"]) log.info("Record #%d saved at %s", len(store["records"]), snapshot["ts"])
except KeyboardInterrupt: except KeyboardInterrupt: