Fix sync client resync condition (ready-tracked, not staging)

This commit is contained in:
2026-09-21 01:07:47 +00:00
parent ea780a20e1
commit 33e3185b39
+4 -1
View File
@@ -147,16 +147,19 @@ class RemoteReplica:
ready_at = 0.0
try:
while True:
if staging is None:
if ready_at:
# Periodic reconnects give full-snapshot reconciliation
remaining = self.remote.refresh_interval - (
time.monotonic() - ready_at
)
if remaining <= 0:
return
try:
message = msgspec.json.decode(
await asyncio.wait_for(ws.recv(), remaining)
)
except TimeoutError:
return # periodic resync: reconnect for a snapshot
else:
message = msgspec.json.decode(await ws.recv())
mtype = message.get("type")