fix(app, android)!: run makeGooglePlayServicesAvailable on main thread#9107
fix(app, android)!: run makeGooglePlayServicesAvailable on main thread#9107just1and0 wants to merge 1 commit into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9107 +/- ##
============================================
- Coverage 65.84% 65.79% -0.05%
Complexity 1832 1832
============================================
Files 497 497
Lines 38761 38774 +13
Branches 5723 5725 +2
============================================
- Hits 25518 25506 -12
- Misses 11770 11792 +22
- Partials 1473 1476 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
mikehardy
left a comment
There was a problem hiding this comment.
the fix is great - needs two tweaks to fit in the larger react-native-firebase context:
1- rebase on top of current main or merge main in and drop the touch on the old arch Java file
2- add v26 migration guide note on the new behavior as indicated
I'm hoping to release v26 soon and I want to ship this break as part of it so I may just do these changes then merge, as I have time
BREAKING CHANGE: On Android, makePlayServicesAvailable previously resolved even when the Play Services availability task was canceled or failed. It may now reject, so callers should handle Promise rejections.
17d0966 to
a20a2c6
Compare
Summary
GoogleApiAvailability.makeGooglePlayServicesAvailable()requires main thread execution but was being called from a React Native background queue, causingIllegalStateExceptionon some Android devices.UiThreadUtil.runOnUiThread()in both the legacy module (ReactNativeFirebaseUtilsModule) and the Turbo module (NativeRNFBTurboUtils).Promiseis now wired to the GoogleTaskresult viaaddOnCompleteListener, handling success, cancellation, and failure so the JS promise always settles.makeGooglePlayServicesAvailable; adjacent Play Services UI methods (promptForPlayServices,resolutionForPlayServices) are not changed in this PR.Fixes #8948
Test plan
androidMakePlayServicesAvailable()— should show the update dialog without crashingplay-services-update-canceled