From 9fe6cbb642c0a532f6e3018a6f6ccd0b841e76a0 Mon Sep 17 00:00:00 2001 From: Umut Erdem Date: Thu, 27 Aug 2026 19:01:26 +0200 Subject: [PATCH] test(ios): eliminate Swift concurrency warnings (#154) Run the doctor-command assertion on the main actor and keep mutable settlement state in the existing actor- isolated test recorder. This removes the Xcode 26.6 warnings without changing app runtime code or the asserted transition. What could go wrong and why this is safe: moving test state could weaken the settlement-transition coverage. The test still proves the same true-to-false transition, the complete 497-test plan and focused 14-test run pass, and the build result contains zero warnings. Fixes #154 --- ios/VaultSyncTests/RelaySetupDoctorTests.swift | 3 ++- ios/VaultSyncTests/ShareAcceptCoordinatorTests.swift | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ios/VaultSyncTests/RelaySetupDoctorTests.swift b/ios/VaultSyncTests/RelaySetupDoctorTests.swift index 095b2a3..4f419ba 100644 --- a/ios/VaultSyncTests/RelaySetupDoctorTests.swift +++ b/ios/VaultSyncTests/RelaySetupDoctorTests.swift @@ -4,7 +4,8 @@ import Testing @Suite("Relay setup --doctor escalation (#91)") struct RelaySetupDoctorTests { - @Test("Doctor command targets the container the installer creates and invokes --doctor") + @Test("Doctor command targets the container the installer creates and invokes --doctor (#154)") + @MainActor func doctorCommandShape() { // The in-app command must keep matching the container name the one-line // installer (and the docker run alternative on the same screen) uses. diff --git a/ios/VaultSyncTests/ShareAcceptCoordinatorTests.swift b/ios/VaultSyncTests/ShareAcceptCoordinatorTests.swift index 79992a5..dd25bec 100644 --- a/ios/VaultSyncTests/ShareAcceptCoordinatorTests.swift +++ b/ios/VaultSyncTests/ShareAcceptCoordinatorTests.swift @@ -15,6 +15,7 @@ struct ShareAcceptCoordinatorTests { var accepts: [(id: String, mergeConfirmed: Bool)] = [] var unignored: [String] = [] var ignored: [String] = [] + var settled = true } private static func env( @@ -144,16 +145,15 @@ struct ShareAcceptCoordinatorTests { #expect(!reached) } - @Test("Merge confirmation re-runs the accept WITH consent and re-checks settlement at confirm time") + @Test("Merge confirmation re-runs the accept WITH consent and re-checks settlement at confirm time (#154)") func confirmMergeRerunsWithConsentAndRevalidates() { let recorder = Recorder() - var settled = true let c = ShareAcceptCoordinator(environment: Self.env( - settled: { settled }, pending: [Self.offer("f1")], recorder: recorder)) + settled: { recorder.settled }, pending: [Self.offer("f1")], recorder: recorder)) let request = ShareAcceptCoordinator.MergeConfirmationRequest(folder: Self.offer("f1"), targetName: "T") c.confirmMergeAccept(request) #expect(recorder.accepts.map { $0.mergeConfirmed } == [true]) - settled = false + recorder.settled = false c.confirmMergeAccept(request) #expect(recorder.accepts.count == 1) // held; transient message instead #expect(c.alertMessage == L10n.tr("Vault locations are still being checked. Try again in a moment."))