Skip to content

@W-21717256 Adding completing callback to resetSessionCookie()#4008

Merged
wmathurin merged 1 commit intoforcedotcom:devfrom
wmathurin:dev
Mar 24, 2026
Merged

@W-21717256 Adding completing callback to resetSessionCookie()#4008
wmathurin merged 1 commit intoforcedotcom:devfrom
wmathurin:dev

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

That will allow us to fix the race condition causing infinite login loop in hybrid auth (where we call resetSessionCookie before setting cookies)

That will allow us to fix the race condition causing infinite login loop in hybrid auth (where we call resetSessionCookie before setting cookies)
@wmathurin wmathurin requested a review from bbirman March 24, 2026 21:39
@github-actions
Copy link
Copy Markdown

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^18 Test Results603 ran600 ✅3 ❌
TestResult
SalesforceSDKCore iOS ^18 Test Results
LoginOptionsViewControllerTests.testBootConfigPickerViewRendered()❌ failure
NativeLoginManagerTests.testPasswordValidation()❌ failure
SalesforceRestAPITests.testUpdateWithIfUnmodifiedSince (failure 1/2)❌ failure
SalesforceRestAPITests.testUpdateWithIfUnmodifiedSince (failure 2/2)❌ failure

@github-actions
Copy link
Copy Markdown

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results603 ran601 ✅2 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
DomainDiscoveryCoordinatorTests.testMissingMyDomain()❌ failure
SalesforceRestAPITests.testCreateQuerySearchDelete❌ failure

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.22%. Comparing base (d7837dc) to head (0c598bf).
⚠️ Report is 40 commits behind head on dev.

Files with missing lines Patch % Lines
...ceSDKCore/Classes/Common/WebViewStateManager.swift 75.00% 1 Missing ⚠️

❌ Your patch status 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    #4008      +/-   ##
==========================================
- Coverage   68.54%   67.22%   -1.33%     
==========================================
  Files         253      253              
  Lines       22289    22337      +48     
==========================================
- Hits        15278    15016     -262     
- Misses       7011     7321     +310     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 69.76% <ø> (ø)
Core 60.13% <98.52%> (-2.05%) ⬇️
SmartStore 74.59% <ø> (ø)
MobileSync 87.41% <ø> (ø)
Files with missing lines Coverage Δ
...ceSDKCore/Classes/Common/WebViewStateManager.swift 46.51% <75.00%> (+2.92%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown

TestsPassed ☑️SkippedFailed ❌️
AuthFlowTester UI Test Results all2 ran1 ✅1 ❌
TestResult
AuthFlowTester UI Test Results all
LegacyLoginTests
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@@ -53,13 +53,21 @@ public class SFSDKWebViewStateManager: NSObject {
@objc
@MainActor
public static func resetSessionCookie() {
Copy link
Copy Markdown
Contributor Author

@wmathurin wmathurin Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 13.0.0 and earlier this method was implemented as follow

+ (void)resetSessionCookie {
    if (_sessionCookieManagementDisabled) {
        [SFSDKCoreLogger d:self format:@"[%@ %@]: Cookie Management disabled. Will do nothing.", NSStringFromClass(self), NSStringFromSelector(_cmd)];
        return;
    }
    [self removeWKWebViewCookies];
}

As a result, there was no race conditions calling resetSessionCookie and then calling setCookies.

@wmathurin wmathurin changed the title Adding completing callback to resetSessionCookie() @W-21717256 Adding completing callback to resetSessionCookie() Mar 24, 2026
@wmathurin wmathurin requested a review from brandonpage March 24, 2026 21:56
@wmathurin wmathurin merged commit d6ec210 into forcedotcom:dev Mar 24, 2026
22 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants