forcedotcom / SalesforceMobileSDK-Android

Android SDK for Salesforce
Other
339 stars 384 forks source link

@W-14831222: [Android] NullPointerException: userAccount must not be null on app foreground with biometrics #2537

Closed JohnsonEricAtSalesforce closed 2 months ago

JohnsonEricAtSalesforce commented 2 months ago

🎸 Ready For Review 🥁

This guards for a reported null pointer crash in the biometric authentication manager. Though, it does not solve for why an Android Account exists that a UserAccount cannot be derived from. Potentially, more research would be needed in UserAccountManager.buildUserAccount(Account) to identify the gap or to gather metrics related to the actual Account data at runtime. The immediate goal is to reduce the impact of the observed crashes and improve the user experience. Here's a follow-up work item for that effort: W-15381271: -MSDK Android- Android Account Is Sometimes Null In BiometricAuthenticationManager shouldLock

mobilesdk-bot commented 2 months ago
2 Warnings
:warning: libs/SalesforceSDK/src/com/salesforce/androidsdk/accounts/UserAccountManager.java#L106 - Do not place Android context classes in static fields (static reference to UserAccountManager which has field context pointing to Context); this is a memory leak
:warning: libs/SalesforceSDK/src/com/salesforce/androidsdk/accounts/UserAccountManager.java#L147 - Consider using apply() instead; commit writes its data to persistent storage immediately, whereas apply will handle it in the background

Tests results for SalesforceSDK

Generated by :no_entry_sign: Danger