Skip to content

Fix Token Migration silent failure.#2892

Merged
brandonpage merged 1 commit into
forcedotcom:devfrom
brandonpage:fix-token-migration-silent-failure
May 20, 2026
Merged

Fix Token Migration silent failure.#2892
brandonpage merged 1 commit into
forcedotcom:devfrom
brandonpage:fix-token-migration-silent-failure

Conversation

@brandonpage
Copy link
Copy Markdown
Contributor

Migration always uses the Web Server regardless of the user's preferred login flow because LoginViewModel.generateMigrationAuthorizationPath hard-codes useWebServerAuthentication = true by design. The OAuth callback therefore always carries an authorization code rather than a token fragment so we should exchange it for tokens unconditionally.

Copy link
Copy Markdown
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 think that iOS supports both but I only wrote tests that migrates from using user agent to using web server flow (not the other way around).

Given that user agent is going away and that apps are planning to move to using web server flow before using the new migration APIs, I'm fine with only doing web server flow for refresh token migration.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.08%. Comparing base (8d3f50e) to head (4104691).
⚠️ Report is 9 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #2892   +/-   ##
=========================================
  Coverage     55.07%   55.08%           
- Complexity     2502     2508    +6     
=========================================
  Files           226      226           
  Lines         17781    17774    -7     
  Branches       2328     2327    -1     
=========================================
- Hits           9793     9790    -3     
+ Misses         6981     6980    -1     
+ Partials       1007     1004    -3     
Components Coverage Δ
Analytics 48.71% <ø> (ø)
SalesforceSDK 41.73% <100.00%> (-0.01%) ⬇️
Hybrid 59.30% <ø> (ø)
SmartStore 78.22% <ø> (ø)
MobileSync 82.12% <ø> (ø)
React 51.50% <ø> (ø)
Files with missing lines Coverage Δ
...salesforce/androidsdk/ui/TokenMigrationActivity.kt 83.47% <100.00%> (-0.95%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce left a comment

Choose a reason for hiding this comment

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

👍🏻

@brandonpage brandonpage merged commit e66d839 into forcedotcom:dev May 20, 2026
18 of 20 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.

3 participants