From 4ae356c4cbcc696fc4e5e30492f7e7cadafa99f0 Mon Sep 17 00:00:00 2001 From: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com> Date: Sat, 14 Nov 2026 17:09:48 +0530 Subject: [PATCH] fix: log checkpoint and rolling-state load failures instead of printing Three recovery paths in ConnectionRouter print a hand-prefixed "Warning: ..." to stdout, so a caller cannot silence, capture or route the message. The module already imports logging, defines a module logger and uses logger.warning for the same kind of recoverable problem elsewhere in the file. --- syft/sync/connections/connection_router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syft/sync/connections/connection_router.py b/syft/sync/connections/connection_router.py index 851bf4ea828..ac2866f2e4a 100644 --- a/syft/sync/connections/connection_router.py +++ b/syft/sync/connections/connection_router.py @@ -489,7 +489,7 @@ def get_latest_checkpoint(self) -> Checkpoint | None: raw = self.peer_store.decrypt_and_verify_for_self_if_needed(raw) return Checkpoint.from_compressed_data(raw) except Exception as e: - print(f"Warning: Failed to load checkpoint: {e}") + logger.warning(f"Failed to load checkpoint: {e}") return None def get_events_count_since_checkpoint( @@ -532,7 +532,7 @@ def get_all_incremental_checkpoints(self) -> List[IncrementalCheckpoint]: cp = IncrementalCheckpoint.from_compressed_data(raw) checkpoints.append(cp) except Exception as e: - print(f"Warning: Failed to load incremental checkpoint: {e}") + logger.warning(f"Failed to load incremental checkpoint: {e}") continue return sorted(checkpoints, key=lambda c: c.sequence_number) @@ -569,7 +569,7 @@ def get_rolling_state(self) -> RollingState | None: raw = self.peer_store.decrypt_and_verify_for_self_if_needed(raw) return RollingState.from_compressed_data(raw) except Exception as e: - print(f"Warning: Failed to load rolling state: {e}") + logger.warning(f"Failed to load rolling state: {e}") return None def delete_rolling_state(self) -> None: