Fix nil-sceneId crash on advanced-auth browser callback for pre-scene logins (#4098) - #4122
Merged
Merged
Conversation
… logins (#4098) Fix nil-sceneId crash on advanced-auth browser callback for pre-scene logins
Generated by 🚫 Danger |
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
||||||||||||||||||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4122 +/- ##
==========================================
- Coverage 66.91% 66.85% -0.07%
==========================================
Files 260 260
Lines 22533 22536 +3
==========================================
- Hits 15079 15066 -13
- Misses 7454 7470 +16
🚀 New features to boost your workflow:
|
|
||||||||||||||
wmathurin
approved these changes
Aug 5, 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.
What
Cherry-picks #4098 onto
master. Original PR was merged todev; this brings the same fix to themasterbranch.Fixes a crash on the advanced-authentication browser callback for logins that start before any
UIScenehas connected — i.e. apps that begin login fromAppDelegate.didFinishLaunchingWithOptions(hybrid and React Native).Root cause
When login starts pre-scene,
request.scene.session.persistentIdentifierisnil, soSFSDKAuthSession.sceneIdwasnil. On theASWebAuthenticationSessioncompletion handler, the SDK built an options dictionary keyed by the scene id (kSFIDPSceneIdKey) and looked the session back up in theauthSessionsstore by that id. Anilkey both crashed the dictionary insert and dropped the session from the store.Fix
SFSDKAuthSession.m— synthesize a unique per-session scene id (com.salesforce.mobilesdk.unscopedAuthSession-<UUID>) when no scene is connected.SFOAuthCoordinator.m/+Internal.h— extract option-building into-browserCallbackOptionsForSceneId:with anilguard.SFOAuthCoordinatorTests.m— unit tests covering the scene-less login case.Testing
master; resulting tree is byte-identical to the merged PR. No dev-only dependencies — all referenced symbols exist in the master baseline.SalesforceSDKCoretest build succeeded; all 5SFOAuthCoordinatorTestspassed (0 failures), including the 4 new scene-less / nil-guard tests.Work item
@W-23733618@