From 9a9026e33a59c561dc8e4107628962eefb21ece3 Mon Sep 17 00:00:00 2001 From: funman300 Date: Fri, 1 May 2026 18:04:56 +0000 Subject: [PATCH] fix(engine): silence benign UnsupportedPlatform warn on exit push_on_exit logged every error including LocalOnlyProvider's expected UnsupportedPlatform response, producing a misleading "sync push on exit failed" warning on every shutdown in local-only mode. Mirror the pull path: treat UnsupportedPlatform as silent no-op, warn only on real errors. Co-Authored-By: Claude Opus 4.7 (1M context) --- solitaire_engine/src/sync_plugin.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/solitaire_engine/src/sync_plugin.rs b/solitaire_engine/src/sync_plugin.rs index 8d770b4..f2b22e0 100644 --- a/solitaire_engine/src/sync_plugin.rs +++ b/solitaire_engine/src/sync_plugin.rs @@ -248,10 +248,18 @@ fn push_on_exit( Ok(handle) => handle.block_on(provider.push(&payload)), Err(_) => future::block_on(provider.push(&payload)), }; - if let Err(e) = result { - // Log push failures on exit so they appear in crash/log reports. - // We cannot surface them to the UI at this point (game loop is done). - warn!("sync push on exit failed: {e}"); + match result { + Ok(_) => {} + // `UnsupportedPlatform` is the expected response of + // `LocalOnlyProvider`; treat it the same as the pull path does — + // no backend configured is not a failure. + Err(SyncError::UnsupportedPlatform) => {} + Err(e) => { + // Log real push failures on exit so they appear in crash/log + // reports. We cannot surface them to the UI at this point (game + // loop is done). + warn!("sync push on exit failed: {e}"); + } } }