diff --git a/android/app/src/main/java/com/labfytools/trainlog/ui/SyncScreen.kt b/android/app/src/main/java/com/labfytools/trainlog/ui/SyncScreen.kt index e925e3c..f830f1d 100644 --- a/android/app/src/main/java/com/labfytools/trainlog/ui/SyncScreen.kt +++ b/android/app/src/main/java/com/labfytools/trainlog/ui/SyncScreen.kt @@ -55,6 +55,16 @@ internal suspend fun publishBundleAndRequest( return@withContext SyncRequestResult.Error("prepare:${opened.message}") } val snapshot = (opened as com.labfytools.trainlog.data.DirectExchangeSnapshotResult.Ready).snapshot + /* CONTRACT: the request signal remains compatible with an unconfigured + * desktop, so publish the strict standalone V3 snapshot before admission. + * A configured daemon still routes the signal exclusively to the complete + * generation below; this compatibility publication never selects V3. */ + when (val publication = exporter.exportMobileBundle(snapshot)) { + SyncExportResult.Unsupported -> return@withContext SyncRequestResult.Unsupported + is SyncExportResult.Error -> + return@withContext SyncRequestResult.Error("prepare:${publication.message}") + is SyncExportResult.Exported -> Unit + } return@withContext when ( val result = SyncGenerationForegroundCoordinator(repository).run( canonicalExchangeDirectory(), diff --git a/tests/test_syncd_routing.py b/tests/test_syncd_routing.py index cdd7209..70c72de 100644 --- a/tests/test_syncd_routing.py +++ b/tests/test_syncd_routing.py @@ -81,7 +81,8 @@ class SyncdRoutingTest(unittest.TestCase): )[0] self.assertIn("SyncGenerationForegroundCoordinator(repository).run", production) self.assertNotIn("generation-opt-in", production) - self.assertNotIn("exportMobileBundle", production) + self.assertIn("exportMobileBundle", production) + self.assertIn("generation below", production) if __name__ == "__main__":