-
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
[🐛] 🔥 Wrong crash attributes on iOS #7835
Comments
Interesting - 1- javascript implementation is here, does some basic argument validation then defers immediately to native: react-native-firebase/packages/crashlytics/lib/index.js Lines 76 to 90 in d849667
2- java implementation similarly does a basic validation that crashlytics is enabled at all, then delegates immediately to firebase-android-sdk: Lines 118 to 124 in d849667
3- objective-c also just verifies that crashlytics is enabled then sets the attribute via immediate delegate call to firebase-ios-sdk method: react-native-firebase/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsModule.m Lines 128 to 137 in d849667
By deduction: one of the attributes from report 1 or report 2 would be missing if the argument validation logic or crashlytics enabled verification logic were false, but the attributes are both set (and incorrectly mingled on iOS) so we may infer that we are definitely calling into firebase-ios-sdk with the setAttribute calls Given there is nothing else happening in this layer of the stack, I think this points to an issue in firebase-ios-sdk I believe the best next step is to make a similar reproduction using the Crashlytics quickstart https://github.com/firebase/quickstart-ios/tree/main/crashlytics and logging an issue in firebase-ios-sdk repo pointing at the issue there as I think that's where the fault is located Note especially that if you run the quickstart app under Xcode there is a debugger attached which interferes with Crashlytics: https://github.com/firebase/quickstart-ios/tree/main/crashlytics#trigger-a-crash-in-crashlytics-quickstart-app - this causes a lot of confusion sometimes. You have to launch it manually, not under Xcode Adding the setAttributes calls (and another crash button) is hopefully a trivial extension to the quickstart so the repro is fast - there is example code included in my code permalinks above |
Hi @mikehardy! Thanks for the quick response. It appears that your deduction was right. I took the Crashlytics quickstart project, duplicated the crash button, and added the error attributes: struct CrashButtonView: View {
var body: some View {
NavigationView {
VStack {
Button(action: {
let crashlyticsReference = Crashlytics.crashlytics()
crashlyticsReference.setCustomValue("value1", forKey: "some_attribute")
crashlyticsReference.setCustomValue("value", forKey: "another_attribute")
let error = NSError(domain: NSURLErrorDomain, code: -1001, userInfo: nil)
Crashlytics.crashlytics().record(error: error)
}) {
Text("Send Error 1")
}
Button(action: {
let crashlyticsReference = Crashlytics.crashlytics()
crashlyticsReference.setCustomValue("value2", forKey: "some_attribute")
let error = NSError(domain: NSURLErrorDomain, code: -1002, userInfo: nil)
Crashlytics.crashlytics().record(error: error)
}) {
Text("Send Error 2")
}
}
.navigationTitle("Crashlytics Example")
}
}
} And, after repeating the experiment, I can see that the bug persists: For Error 1:For Error 2:Both reports have Thanks again for the analysis! |
Here is the firebase-sdk-ios issue that I created, for future reference: firebase/firebase-ios-sdk#13124 |
Reproductions like you've done are worth more than all the words I can put in a comment box, so your effort is the real motive force here, thanks for pursuing it upstream and hopefully there's a quick resolution - cheers |
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
Issue
When sending two non fatal reports with
recordError()
and some attributes, the first report has the attributes of the second in the Crashlytics dashboard. On Android the behavior is correct (i.e. the first and second report have their corresponding attributes), this is an iOS only issue.To test it, I set up an empty app with two buttons to send two error reports:
On iOS, if I press the "Send Error 1" button, then press the "Send Error 2" button, and restart the app, I get the following records on the dashboard:
For Error 1:
For Error 2:
As can be seen in the screenshots, the first report has
some_attribute
set tovalue2
, despite its being set tovalue1
right before callingrecordError()
. Doing exactly the same on Android, I get the right behavior:For Error 1:
For Error 2:
The "Error 1" report has
some_attribute
set tovalue1
as expected.Is this difference between platforms a bug, or an intended behavior?
Thanks in advance.
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.kt
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:20.1.0
Firebase
module(s) you're using that has the issue:Crashlytics
TypeScript
?Y
&5.0.4
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: