From 33e3185b397998b933379d04830de7eb40fbb9ba Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 21 Sep 2026 01:07:47 +0000 Subject: [PATCH] Fix sync client resync condition (ready-tracked, not staging) --- paskia/satellite.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paskia/satellite.py b/paskia/satellite.py index ba5ecaf..c5d62db 100644 --- a/paskia/satellite.py +++ b/paskia/satellite.py @@ -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 - message = msgspec.json.decode( - await asyncio.wait_for(ws.recv(), remaining) - ) + 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")