Skip to content

[iOS] Move mainSid calculation to SFOAuthCredentials - #4153

Merged
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:main-sid
Aug 28, 2026
Merged

[iOS] Move mainSid calculation to SFOAuthCredentials#4153
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:main-sid

Conversation

@wmathurin

Copy link
Copy Markdown
Contributor

Summary

  • Adds a mainSid computed property to SFOAuthCredentials that returns parentSid for JWT token format and accessToken otherwise
  • Simplifies SalesforceWebViewCookieManager.swift (in the iOS-Hybrid repo) to use creds.mainSid directly — that change is in a separate draft PR (SalesforceMobileSDK-iOS-Hybrid) blocked on this one merging first
  • Adds 2 unit tests to SFOAuthCredentialsTests.m covering both branches of the logic

GUS

  • W-24023805

Test plan

  • testMainSid_withNonJwtFormat_returnsAccessToken — passes (new)
  • testMainSid_withJwtFormat_returnsParentSid — passes (new)
  • Full SalesforceSDKCore test suite — no regressions

Move the JWT vs access-token selection logic out of SalesforceWebViewCookieManager
and into SFOAuthCredentials.mainSid, so any caller gets the correct SID without
repeating the conditional.
@github-actions

Copy link
Copy Markdown
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
SFOAuthCredentials Dereference of null pointer Logic error Access to instance variable '_credentialsChangeSet' results in a dereference of a null pointer (loaded from variable 'self') 199 27
SFOAuthCredentials Nullability Memory error nil passed to a callee that requires a non-null 1st parameter 304 20

Generated by 🚫 Danger

@github-actions

Copy link
Copy Markdown
TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all1 ran1 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@github-actions

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^18 Test Results1011 ran1011 ✅
TestResult
No test annotations available

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.46%. Comparing base (7fb2f46) to head (33d3b55).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4153      +/-   ##
==========================================
- Coverage   70.37%   67.46%   -2.91%     
==========================================
  Files         254      254              
  Lines       22849    22859      +10     
==========================================
- Hits        16080    15422     -658     
- Misses       6769     7437     +668     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.88% <ø> (ø)
Core 61.12% <93.75%> (-4.37%) ⬇️
SmartStore 73.45% <ø> (ø)
MobileSync 88.84% <ø> (ø)
Files with missing lines Coverage Δ
...lesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m 92.00% <100.00%> (-0.96%) ⬇️

... and 29 files with indirect coverage changes

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

@sfdctaka sfdctaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@wmathurin
wmathurin merged commit 5ac040a into forcedotcom:dev Aug 28, 2026
23 of 24 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