-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🔥][🐛] [Android] App crashing on ConcurrentModificationException (ReactNativeFirebaseAuthModule) #6798
Comments
Hi there, I can look at this a bit later but please respond first and let me know if you still reproduce this on current versions, troubleshooting older versions is inefficient and not something we do in general |
Thanks for looking into this @mikehardy. We're currently only using |
+1 we are also seeing this behavior, we're unable to reproduce it locally but its flaring up on our crashlytics reports, running the latest versions. Identical behavior as above where a user has just opened the app, user is signed in and then immediately crashes with ConcurrentModificationException. |
+1 were also encountering this error in production. Same error stack. Unfortunately we are unable to replicate it locally but in production it crashes after the splash screen. Here's the error stack in crash reporting tool.
|
+1 We are also encountering this error. @jianhui-chan were you able to mitigate the issue on your end? |
@isystem20 nope, I haven't found a solution for this issue |
We're now seeing this crash hit around 8% of our active users. |
No one has confirmed this happens on current stable versions. Someone please confirm this happens with current stable versions. |
Sorry this is happening for us on 16.5.0, RN 0.71.0. Will do another release today with 16.5.1 to see if this has an impact. |
@lwts thanks for confirming! 16.5.1 will not have an impact here, nothing in the area that would throw this stack changed. Always excited to have confirmation + stack traces but of course sorry this is happening for folks. I'll take a look |
The auth provider data may apparently be modified while being iterated to send to listeners, resulting in a classic ConcurrentModificationException crash Using a shallow copy of the collection for iteration should be a functional equivalent, but without the unwanted "feature" of crashing Fixes #6798
The patch to fix this is I think fairly trivial. I've posted a PR for it here, and I would love if someone could try the patch set containing the fix (via patch-package) to make sure this fixes things for them. The patch set will be available here once the github actions workflow is done generating it: https://github.com/invertase/react-native-firebase/actions/runs/3975850361 |
Awesome thanks for the quick turnaround - implementing now and then we'll do a small scale roll out to check it fixes it. Should be able to get an idea within around 6 or so hours. EDIT: Looking good so far, has not reappeared. Will check again in the morning (8 or so hours) to confirm with newly updated users that nothing's popped up. |
Great - I took a break over the holidays but just did a release when I came back to make sure all the release machinery was 💯 and the queue was clear. So this will be a trivial patch release + easy to do as soon as you confirm. I could honestly do it now but as long as I have a motivated tester with the patch, might as well wait for the real results. Thanks for testing! |
Yeah it's still looking clear with a much larger roll out now so probs good to release. Thanks! |
Okay, I'll merge that and do a release - thanks again for testing+reporting Just so you are aware as maybe you can avoid extra work? - the release will be literally nothing but the current stable release (16.5.1) plus the patch-package you already integrated, and nothing else. It will be 16.5.2. Stated differently, if you have 16.5.1+those patches you already have 16.5.2 as it will be released so if you want to avoid re-releasing you might save some technically-duplicate effort. Obviously do whatever your release policies call for though :-). Cheers |
The auth provider data may apparently be modified while being iterated to send to listeners, resulting in a classic ConcurrentModificationException crash Using a shallow copy of the collection for iteration should be a functional equivalent, but without the unwanted "feature" of crashing Fixes #6798
Does this patch work for 14.11.1 as well? |
@MishaFrenkman you'll have to try it and see, v14 is no longer supported. The code has not changed that much, I give it a 95% of applying cleanly, 5% of just needing a slight tweak in order to work. Shouldn't be too bad |
I wasn't able to do the patch as is on v14, but the origin bug report is referencing v14 as well. @jianhui-chan were you able to get the patch running or did you just upgrade to newer version? Thanks |
same issue for us, any update? |
Issue
Hello,
We've been seeing reports in Sentry that many of our Android users are experiencing crashes due to a
ConcurrentModificationException
happening when theonIdTokenChanged
listener is being registered.We have not been able to replicate it locally so we're not exactly sure how this is happening as well.
Here is the stack trace for the error:
The behaviour we are observing (through Sentry) is as follows:
Here is how we are registering the listener:
In
componentDidMount
, we are checking (via remote config) if firebase login is enabled and then registering the listener if it is enabled.Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.java
:AndroidManifest.xml
:Environment
Click To Expand
As mentioned, we've not been able to replicate this locally but this is a list of devices that have been experiencing this issue:
react-native-firebase
version you're using that has this issue:^14.11.0
Firebase
module(s) you're using that has the issue:@react-native-firebase/auth
TypeScript
?Y
&^4.5.5
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: