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.
Adopts Swift 6 and its data race safety features. This should be a non-breaking change in terms of code (it didn't require changes to the sample app used to test the SDK), but does seem to require being on the latest XCode beta which could trigger some workflow breakage. I'm not sure the best way to handle that in terms of versioning, but in any case I'm temporarily blocked by the supported CI actions.
To make this work, the following changes were adopted:
@MainActor
added to the SDKSendable
added to a couple data structuresASPresentationAnchor.default
extension reworked as a computed property instead of afileprivate let
nonisolated
(required for protocol compliance), and some of their internals are wrapped inTask { @MainActor in ... }
to get back to the right actor.I tried a couple other approaches that felt like they'd be less likely to hog resources on the main thread (generally, trying to make
SnapAuth
conform toSendable
or turn into anActor
) that clearly weren't going anywhere without pretty substantial refactoring. I won't pretend to be a Swift expert; if someone who is chimes in with a better way, this can be revisited.Posting as-is for review, but the CI tooling will need some updates before this will build and can be landed. I expect this will solidify closer to the fall OS releases.
Fixes #26