fix(auth): preserve per-user AA flag on token refresh (W-23616382) - #4124
Open
wmathurin wants to merge 1 commit into
Open
fix(auth): preserve per-user AA flag on token refresh (W-23616382)#4124wmathurin wants to merge 1 commit into
wmathurin wants to merge 1 commit into
Conversation
Move the AA transient-global→per-user promotion block inside the `completedAuthType != SFOAuthTypeRefresh` guard in `finalizeAuthCompletion:`, so silent token refreshes never unregister the persisted AA flag. The global clear fires unconditionally outside the guard as before. WD and QR are already correctly placed inside the guard; this fix brings AA into line with them. Add two regression tests in SFSDKAppFeatureMarkersTests: - test_givenAAFlagPersistedOnUser_whenTokenRefreshCompletes_thenAAFlagPreserved - test_givenAARegisteredGlobally_whenNonRefreshLoginCompletes_thenAAPromotedToUserAndGlobalCleared
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
||||||||||||||||||
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #4124 +/- ##
==========================================
- Coverage 71.35% 67.16% -4.19%
==========================================
Files 254 254
Lines 22557 22557
==========================================
- Hits 16095 15150 -945
- Misses 6462 7407 +945
🚀 New features to boost your workflow:
|
|
||||||||||||||
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.
Summary
AA(App Attestation) per-user promotion block inside thecompletedAuthType != SFOAuthTypeRefreshguard infinalizeAuthCompletion:inSFUserAccountManager.munregisterAppFeature:forUser:when the transient global was absent — silently clearing the persistedAAflag on every refreshunregisterAppFeature:kSFAppFeatureAppAttestation) fires unconditionally outside the guard, as intendedWDandQRwere already correctly placed inside the guard; this bringsAAinto alignment with themTest plan
SFSDKAppFeatureMarkersTests— all 22 tests pass (verified locally)test_givenAAFlagPersistedOnUser_whenTokenRefreshCompletes_thenAAFlagPreserved— new regression testtest_givenAARegisteredGlobally_whenNonRefreshLoginCompletes_thenAAPromotedToUserAndGlobalCleared— new regression testGUS: W-23616382