fix(tests): restore FlipcashTests compilation under Xcode 27 main-actor isolation - #526
Merged
Merged
Conversation
…or isolation The module defaults to main-actor isolation under Swift 6 / Xcode 27, which makes app symbols like StoredMintMetadata.metadata/.init and URL's sanitizedForAnalytics main-actor-isolated. Four test suites referenced them from a nonisolated context, failing to compile and taking the whole FlipcashTests bundle down at link: - Regression_69ea28b0, URLSanitizationTests, DatabaseMintUpsertTests: annotate the suite @mainactor (matching the convention already used across the test target). - ProfileCreationStateTests: its StubUploader was an actor, which cannot conform to the now-main-actor-isolated ProfilePictureUploading protocol. Convert it to a @mainactor final class and drop the now-needless awaits on its synchronous accessors. All four suites compile and pass; the test target builds and links again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
FlipcashTestsbundle fails to link onmainunder Xcode 27 / Swift 6. The app module defaults to main-actor isolation, which makes app symbols such asStoredMintMetadata.metadata/StoredMintMetadata.init(_:)andURL.sanitizedForAnalyticsmain-actor-isolated. Four test suites referenced them from a nonisolated context, so they failed to compile — and a single failing file takes the whole test bundle down at link, blocking the entire suite from running.Surfaced while verifying the tip-payload change (#523), whose
TipCodeEncodingTestscouldn't execute because of this.Fix
Same root cause, minimal per-suite fixes:
Regression_69ea28b0,URLSanitizationTests,Database+MintUpsertTests— annotate the suite@MainActor(matching the convention already used by many suites in this target, e.g.ChatPreviewMappingTests,WithdrawViewModelTests).ProfileCreationStateTests— itsStubUploaderwas anactor, which cannot conform to the now-main-actor-isolatedProfilePictureUploadingprotocol. Converted to a@MainActor final classand dropped the now-needlessawaits on its synchronous accessors. The suite is already@MainActor.No test logic changed — these are compile-time isolation annotations only.
Testing
xcodebuild build-for-testing(iPhone 16 Pro sim) links the fullFlipcashTeststarget again.Regression_69ea28b0,ProfileCreationStateTests,URLSanitizationTests,DatabaseMintUpsertTests.