Skip to content

Fixing retry race condition#4001

Merged
bbirman merged 3 commits intoforcedotcom:devfrom
bbirman:rest-fix
Mar 12, 2026
Merged

Fixing retry race condition#4001
bbirman merged 3 commits intoforcedotcom:devfrom
bbirman:rest-fix

Conversation

@bbirman
Copy link
Member

@bbirman bbirman commented Mar 5, 2026

Still testing and would need to test against the the fork as well but want to get a CI run going for 13.2

@salesforce-cla
Copy link

salesforce-cla bot commented Mar 5, 2026

Thanks for the contribution! It looks like @amisha10 is an internal user so signing the CLA is not required. However, we need to confirm this.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

1 Warning
⚠️ Static Analysis found an issue with one or more files you modified. Please fix the issue(s).

Clang Static Analysis Issues

File Type Category Description Line Col
SFRestAPI Nullability Memory error nil assigned to a pointer which is expected to have non-null value 98 5

Generated by 🚫 Danger

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^18 Test Results597 ran597 ✅
TestResult
No test annotations available

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.76%. Comparing base (83e8777) to head (42df831).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4001      +/-   ##
==========================================
+ Coverage   62.65%   65.76%   +3.10%     
==========================================
  Files         254      253       -1     
  Lines       22429    22298     -131     
==========================================
+ Hits        14054    14664     +610     
+ Misses       8375     7634     -741     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 69.76% <ø> (ø)
Core 57.82% <100.00%> (+4.77%) ⬆️
SmartStore 74.59% <ø> (ø)
MobileSync 87.41% <ø> (ø)
Files with missing lines Coverage Δ
...Core/SalesforceSDKCore/Classes/RestAPI/SFRestAPI.m 87.73% <100.00%> (+0.21%) ⬆️

... and 28 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

github-actions bot commented Mar 5, 2026

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results597 ran596 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
DomainDiscoveryCoordinatorTests.testNonCallbackURL()❌ failure

Copy link
Contributor

@wmathurin wmathurin left a comment

Choose a reason for hiding this comment

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

I guess the scenario that caused the issue is where multiple requests are issued, one gets a 401 triggering a refresh and the refresh actually completes before the dataResponseBlock of some of the other requests already sent have run (e.g. if they are slow for whatever reasons e.g. if they have large payloads).

When refresh completes, pending requests are replayed, causing new data tasks to be created for each one. Not cancelling or preventing the "old" dataResponseBlock from running caused a re-refresh and a unnecessary replay of the request and as a result a double callback leading to a double continuation resume error.

@bbirman bbirman mentioned this pull request Mar 9, 2026
@salesforce-cla
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Brianna Birman <b***@b***.i***.s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated.

@bbirman bbirman marked this pull request as ready for review March 10, 2026 23:27
@bbirman
Copy link
Member Author

bbirman commented Mar 10, 2026

The merge commit had the wrong email from switching to a new laptop, updated so the CLA bot message shouldn't be an issue

@github-actions
Copy link

TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all3 ran3 ❌
TestResult
AuthFlowTester UI Test Results all
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 1/2)❌ failure
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 2/2)❌ failure
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 1/2)❌ failure
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 2/2)❌ failure
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 1/2)❌ failure
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow() (failure 2/2)❌ failure

@bbirman bbirman merged commit 31742a2 into forcedotcom:dev Mar 12, 2026
33 of 40 checks passed
@bbirman bbirman deleted the rest-fix branch March 12, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants