Skip to content

[ReactNative][Android] react-native-force calls removed ClientManager.peekUnauthenticatedRestClient() - #489

Merged
JohnsonEricAtSalesforce merged 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:bugfix/reactnative-android-react-native-force-calls-removed-clientmanager-peekunauthenticatedrestclient
Aug 24, 2026
Merged

[ReactNative][Android] react-native-force calls removed ClientManager.peekUnauthenticatedRestClient()#489
JohnsonEricAtSalesforce merged 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:bugfix/reactnative-android-react-native-force-calls-removed-clientmanager-peekunauthenticatedrestclient

Conversation

@JohnsonEricAtSalesforce

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

SalesforceMobileSDK-Android's ClientManager rewrite for multi-user support (716ee6625) removed APIs that react-native-force's Android bridge depended on, breaking the build for all four React Native Android templates.

  • SalesforceNetReactBridge.kt: replaced removed ClientManager.peekUnauthenticatedRestClient() with SalesforceSDKManager.getInstance().getUnauthenticatedRestClient() (same pattern as the Cordova/Hybrid bridge).
  • SalesforceReactActivity.java: replaced the removed ClientManager.RestClientCallback / async getRestClient(activity, callback) with the SalesforceSDKManager equivalents, and updated logout() to pass all four positional args (the new signature has no @JvmOverloads).

Test plan

  • Local build via this repo's androidTests/ subproject: compileDebugKotlin, compileDebugJavaWithJavac, and :app:assembleDebug all BUILD SUCCESSFUL.
  • End-to-end integration re-test against the pushed branch (template app + yarn install + Android build).

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

…ient()

SalesforceMobileSDK-Android's ClientManager rewrite for multi-user support
(716ee6625) removed peekUnauthenticatedRestClient(), breaking Kotlin
compilation of react-native-force. Use
SalesforceSDKManager.getInstance().getUnauthenticatedRestClient(), the SDK's
replacement API, matching the same pattern already used by the analogous
Cordova/Hybrid bridge.
…tClient and logout() param shape

SalesforceMobileSDK-Android's ClientManager rewrite for multi-user support
(716ee6625) also removed ClientManager.RestClientCallback and the async
ClientManager.getRestClient(activity, callback) overload, and changed
SalesforceSDKManager.logout() to take (account, frontActivity, showLoginPage,
reason) with no @jvmoverloads, so Java callers must supply all four
positional args. Update SalesforceReactActivity's login()/authenticate() to
use SalesforceSDKManager.getInstance().getRestClient(activity, callback) with
SalesforceSDKManager.RestClientCallback (mirroring SalesforceActivityDelegate,
the SDK's own shared Java call site for this pattern), and logout() to pass
the full positional argument list (mirroring UserAccountManager's Java call
site).
@JohnsonEricAtSalesforce

Copy link
Copy Markdown
Contributor Author

CI shows 3 failing checks (android-pr, ios-pr ^18, ios-pr ^26), but these are pre-existing/environmental, not caused by this change:

Android: The actual fix compiles cleanly — react-native-force:compileDebugKotlin and compileDebugJavaWithJavac both succeed (BUILD SUCCESSFUL). The job fails later, in instrumented tests: 35 cases fail with Headless run did not emit BEGIN within 180000ms — app launched but HeadlessTestApp never mounted, a Firebase Test Lab harness issue unrelated to this bridge code.

iOS (^18, ^26): This PR touches no iOS files. The build fails with no visible @interface for 'SFBiometricAuthenticationManagerInternal' declares the selector 'consumeBrowserAuthenticationSuppressionForSceneId:' — an iOS SDK/bridge header mismatch.

Both failure signatures reproduce identically on dev's own Nightly Tests going back to at least 2026-08-13, confirming these are dev-wide breaks predating this branch, not regressions introduced here.

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

@JohnsonEricAtSalesforce
JohnsonEricAtSalesforce merged commit 47abf6a into forcedotcom:dev Aug 24, 2026
6 of 9 checks passed
@JohnsonEricAtSalesforce
JohnsonEricAtSalesforce deleted the bugfix/reactnative-android-react-native-force-calls-removed-clientmanager-peekunauthenticatedrestclient branch August 24, 2026 16:45
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