Skip to content

Preserve Android login hosts with unrestricted MDM - #3060

Merged
brandonpage merged 3 commits into
forcedotcom:devfrom
brandonpage:fix-android-mdm-host-composition
Oct 15, 2026
Merged

brandonpage merged 3 commits into
forcedotcom:devfrom
brandonpage:fix-android-mdm-host-composition

Conversation

@brandonpage

Copy link
Copy Markdown
Contributor

Summary

  • Keep default/app-defined servers.xml hosts and saved user-entered hosts visible when MDM provisions hosts with OnlyShowAuthorizedHosts=false.
  • With usable MDM hosts and OnlyShowAuthorizedHosts=true, display only the current managed hosts while preserving hidden user-entered entries in storage.
  • Keep the MDM payload authoritative: omitted managed hosts are removed, while independently saved custom entries retain their own ownership.
  • Deduplicate by trimmed URL with MDM precedence and preserve selection by URL using the current label/type.
  • Make custom add/remove/replace/reorder operations use their backing store rather than composed display indices. Preserve the existing storage schema and non-null active-selection contract.

Absent, empty, or entirely null/blank MDM host payloads fall back to the normal host list. Defaults and app-defined XML hosts remain one source; there is no new built-in/app-defined split. No OAuth/DPoP or login activity changes are included.

Testing

Instrumented tests ran on Android 12/API 31 in batches following .github/test-shards/SalesforceSDK.json, never as one unfiltered suite.

  • Both manager test classes: 70 passed (included in the remaining shard below).
  • remaining: 956 passed after the final selection-persistence fix.
  • rest-unit: 99 passed.
  • webview: 10 passed.
  • Debug SDK assembly, Android test APK assembly, and SDK lint passed; rerun before committing also passed.
  • git diff --check passed.

Outstanding Validation

  • UI shard is not green: LoginActivityScenarioTest.cancellationCallback_back_notifiesBeforeDestruction repeatedly fails on API 31; the test directly invokes a dispatcher callback registered only for API 33+ in the unchanged activity implementation. No unmodified-baseline run was performed.
  • The UI shard also timed out. A subsequent UI-only subset had a failure in PickerBottomSheetActivityTest.serverPickerHeader_Navigates_AndDisplaysCorrectly after Back navigation; its cause remains unestablished. These UI paths were not modified.
  • Network shard was not run because local test credentials were absent.
  • Customer-device/live-MDM delivery and live OAuth reproduction remain unverified.

This is a draft for review; the known validation gaps are not represented as passing tests.

…wser selector

Scroll Login Options toggles into view before clicking, since the Custom Tab
browser selector pushes the Override Boot Config switch off-screen. Restore the
beaconadvancedopaque/beaconadvancedjwt intent filters needed by the advanced
auth beacon apps.
@brandonpage
brandonpage marked this pull request as ready for review October 14, 2026 23:59

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce 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.

Code verdict: approve on code merits. The current UI check is still running.

Requested Changes

None.

Open Questions

  1. If deleting a saved host reveals a duplicate from the other store, should it appear in the open picker immediately? The manager returns it, but the picker snapshots its list (PickerBottomSheet.kt:349, 580-581), so it appears only after reopening.

This review was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.

@brandonpage

Copy link
Copy Markdown
Contributor Author
  1. If deleting a saved host reveals a duplicate from the other store, should it appear in the open picker immediately? The manager returns it, but the picker snapshots its list (PickerBottomSheet.kt:349, 580-581), so it appears only after reopening.

I am not too concerned with edge cases like this given we still have plans to re-write the underlying data structure.

@JohnsonEricAtSalesforce

Copy link
Copy Markdown
Contributor

Thanks, Brandon. I’m comfortable leaving that edge case as is for this PR, given the planned data structure rewrite.

This response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.

@brandonpage
brandonpage merged commit 80162ef into forcedotcom:dev Oct 15, 2026
9 of 12 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