feat: add @Sendable annotations to closure parameters for Swift 6 compliance#1128
Merged
sanchitmehtagit merged 1 commit intodevelop/v3.0from Mar 26, 2026
Merged
Conversation
sanchitmehtagit
commented
Mar 26, 2026
eba2f48 to
792eac5
Compare
NandanPrabhu
approved these changes
Mar 26, 2026
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.
Motivation
Swift 6 strict concurrency requires closures that escape across
concurrency boundaries to be
@Sendable. Without this, the compileremits warnings (Swift 5 mode) or errors (Swift 6 mode) when SDK
callbacks are passed into
DispatchQueue.async,Task, or anyother concurrent context — which is exactly how the SDK uses them
internally (e.g.
dispatchOnMain,SynchronizationBarrier,IDTokenValidator).This brings the callback-based public API into line with Swift 6
strict concurrency, matching the scope of #1095, and ensures users
adopting Swift 6 don't encounter unexpected compiler errors at their
call sites.
Summary
@Sendableto all escaping closure/callback parameters acrossthe public API and internal SDK utilities
Requestablemocking example inV3_MIGRATION_GUIDE.mdwhich was no longer valid against the updated protocol
Concurrency chapter of the migration guide, clarifying that only
custom protocol implementations (mocks/test doubles) require changes
Files changed
Request.swiftCallbacktypealias +handleproperty →@SendableRequestable.swiftstart(_:)callback →@SendableWebAuth.swiftonClose,start,logoutcallbacks →@SendableAuth0WebAuth.swiftonCloseCallbackproperty +onClose,start,logout→@SendableIDTokenValidator.swiftJWTAsyncValidatorprotocol + implementations →@SendableIDTokenSignatureValidator.swiftvalidate(_:callback:)→@SendableSynchronizationBarrier.swiftpendingOperations+execute(_:)→@SendableOAuth2Grant.swiftcredentials(from:callback:)→@SendableLoginTransaction.swiftFinishTransactiontypealias →@SendableShared.swiftdispatchOnMaininput + return types →@SendableCredentialsManager.swift@SendableV3_MIGRATION_GUIDE.mdTest plan
SWIFT_STRICT_CONCURRENCY = complete