-
Notifications
You must be signed in to change notification settings - Fork 606
Firebase Crashlytics setCustomKeys stacked for all non-fatals #3551
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
Comments
Hi @peterplamenovpenchev, thanks for reporting. I was able to reproduce the same behavior, I'll notify an engineer and see what we can do here. |
We are aware of this inconsistency between iOS and Android. We're considering making the two platforms consistent, but it's not a priority right now. We're hesitant because it would change a behaviour that many customers may currently rely on or expect. Regarding the issue of dropping any keys after the 64th, switching it to retaining the most recently set keys seems like a good improvement and we've logged it as a feature request. |
Thanks! I am really looking forward into the changed behaviour of this aspect of the SDK. @mrober is there a way to implement this on Android atm? I mean - having log specific keys? |
I also ran into this issue. As far as I can tell The Something like this: public void recordException(@NonNull Throwable throwable, @NonNull Map<String, String> userInfo) |
Thanks for the suggestions. We will keep the user info as a feature request. We discussed switching custom keys to retain the most recently set keys, but decided not to do it because it would change a subtle behaviour. For example, setting the most important custom key once at app launch. |
I was confused by the same problem until I understood exactly how Crashlytics 's |
Any update, roadmap? non-fatal API errors in crashlytics are mostly unusuable without custom keys record method, I'm shocked how iOS SDK is much better than Android 😳 |
+1 for @dperez37's suggestion. I think this would be much cleaner and more expressive in many situations. |
I'm also quite surprised that the Android SDK does not allow adding metadata to a single non-fatal exception, just like @almozavr. Coming from iOS, extending non-fatal logs with additional infos via Any insights on the product decision not to add the overload as @dperez37 proposed? I mean, technically, everything is already there I suppose, otherwise it wouldn't work on iOS. 🤔 |
We are facing the same issue, as we have a team working on iOS app, and can attach custom metadata to a specific error, but for Android we can't. |
we have the same error in our app |
We discussed this with the team, and have decided to pull this work to add |
@mrober Can you please provide an update on this? It seems like an important issue to get resolved, since it makes the custom keys somewhat unusable. The Crashlytics documentation specifically states that custom keys should be used for values that are unique to a specific exception. However, this still seems very broken, as it appears that the values are not captured at the time While this suggested improvement of being able to pass key/value pairs as an argument might help, I don't believe it really solves the problem. Because |
@agaluzzi It's been a while since I looked at this, but I believe the custom keys recorded in setCustomKeys are captured loosely at the time of the exception. If memory serves, it's not synchronous as the work to copy the custom key set is run on a dispatcher or an executor (again it's been a while), and it's hard to tell when you can "unset" a custom key that is only related to a specific exception as there are no callbacks to indicate when an exception has officially been recorded. I'm not sure we going to get any movement on this any time soon, but if anyone from firebase responds to anything on this I'll go handle the merge conflicts on the PR. Otherwise, I have mostly given up on this. |
An API overload is now available to address this issue. Marking this as closed. |
[READ] Step 1: Are you in the right place?
Yes
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Result:
When the logs are flushed (at the next app start up) the custom keys are associated with all generated logs.
Effectively this means that in the steps above all non fatal logs have the
key_1
&key_2
associated with them.Another defect caused by the issue is that if the app generates a lot of logs with keys (via
recordException
) is that after the 64thcustomKey
no other keys are added.This produces erroneous log trail by the app & messes up the search by key feature in the Firebase Crashlytics console.
Expected result:
Based on this documentation I am left with the impression that the
customKeys
will be associated with the log they are fired for.Note:
The iOS Crashlytics SDK has the capability of assigning keys for each log by using the
userInfo
inNSError
, but that is not possible on Android (Java/Kotlin) because theThrowable
does not provide such map (hence the SDK does not work in that way).The text was updated successfully, but these errors were encountered: