-
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
🔥 Performance Monitoring module crashing the app on iOS #3736
Comments
@Salakar / @Ehesp crash report with workaround and offer for PR, look good? |
Oh - @MrSltunUxbert make sure it still applies on new versions, I just checked yours and you look like you are a little bit behind current |
@mikehardy I will update the package to the latest version on npm and test if it still crashes |
Yeah that looks correct, I think we had this problem on a few of the other modules. |
@MrSltunUxbert After a little bit of testing it seems to be working with the current release too (7.1.4) |
Having the same problem. When will the fix make it into the official release? Alternatively, @MrSltunUxbert do you have a version that we can point our package.json towards? |
@gilbertl -> https://github.com/ds300/patch-package - don't develop with react-native modules without it... |
In the meantime, if you use patch-package you can use this patch to fix it until a new release is out.
--- a/node_modules/@react-native-firebase/perf/ios/RNFBPerf/RNFBPerfModule.m
+++ b/node_modules/@react-native-firebase/perf/ios/RNFBPerf/RNFBPerfModule.m
@@ -44,11 +44,11 @@
- (void)dealloc {
@synchronized ([self class]) {
- for (NSString *key in traces) {
+ for (NSString *key in [traces allKeys]) {
[traces removeObjectForKey:key];
}
- for (NSString *key in httpMetrics) {
+ for (NSString *key in [httpMetrics allKeys]) {
[httpMetrics removeObjectForKey:key];
}
}
|
This is great. Didn't know about it. Thanks so much. |
Hello 👋, to help manage issues we automatically close stale issues.
|
I don't think this issue has been fixed yet? |
Issue
I installed the performance monitoring module into our application, it works fine and reports to firebase, but sometimes it the app crashes.
And the issue was
Collection <__NSDictionaryM: 0x600002b7e1c0> was mutated while being enumerated
I looked into it and read the error reports, it seemed like the function
dealloc
inRNFBPerfModule.m
was causing the issue.What I did was, I changed the
dealloc
function to this:reference: https://coderwall.com/p/qsty1w/safely-remove-nsmutabledictionary-objects-in-a-loop
I'm not an experienced iOS developer, so I don't know if that's a good solution or not, but it worked for me and since I changed the code, the app didn't crash.
If that's a good solution, I'd be happy to send a PR.
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:# N/A
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
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:6.3.4
Firebase
module(s) you're using that has the issue:Performance Monitoring
TypeScript
?No
The text was updated successfully, but these errors were encountered: