Stabilize flaky Android tests and harden API 37 logout handling - #3026
Merged
brandonpage merged 3 commits intoSep 3, 2026
Merged
Conversation
Generated by 🚫 Danger |
Generated by 🚫 Danger |
brandonpage
commented
Sep 3, 2026
| if (currentAccount != null) { | ||
| SalesforceSDKManager.getInstance().logout( | ||
| currentAccount, frontActivity, showLoginPage, reason); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This production hardening actually came from CI crashing on API 37 when one of the tests called signoutCurrentUser with a null currentUser. The issue is a byproduct of the Android 17 MessageQueue rewrite. Yay for tests (unintentionally) catching real issues.
wmathurin
approved these changes
Sep 3, 2026
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
API 37 production hardening
The API 37 failure included a Binder buffer crash while Android was delivering com.salesforce.CLEANUP after repeated teardown sign-out calls. UserAccountManager.signoutCurrentUser now resolves the current account once and returns without invoking logout when no account exists.
This prevents accidental or repeated null-account sign-out calls in production from emitting unnecessary cleanup and logout broadcasts, reducing one-way Binder traffic in the same path that triggered the API 37 crash. Direct SalesforceSDKManager.logout(null) behavior remains unchanged for callers that intentionally request global cleanup.
NativeLoginManagerTest now relies on this production guard instead of duplicating the account check, while retaining waitForIdleSync for real logout cleanup. UserAccountManagerTest verifies that no LOGOUT_COMPLETE broadcast is emitted when there is no current account.
Verification
Related CI runs: