firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[FR]: Modify custom keys behavior to be consistent with Android

Open luqas11 opened this issue 1 year ago • 2 comments

Description

If multiple non fatal reports are sent, and different custom key values are set between them, all the reports have the the values of the last one. This behavior is not consistent with the Android SDK, where each report is sent with the custom key values set at the moment of calling the recordException method.

For example, if I do the following sequence:

  1. Set key some_attribute with value value1
  2. Send a non-fatal exception with the recordError method
  3. Set key some_attribute with value value2
  4. Send another non-fatal exception with the recordError method
  5. Restart the app

On iOS, both non-fatal errors are shown in the Crashlytics dashboard with the some_attribute key set to value2. On Android, the first and the second non-fatal errors are shown in the Crashlytics dashboard with the some_attribute key set to value1 and value2 respectively.

From my perspective, having different behaviors between platforms adds complexity to the error reporting implementations and while doing error analysis. Before the FR, I created an issue about this, including detailed code examples and screenshots. I got the confirmation that the current behavior is intentional, and that I should report it as a feature request.

Is a behavior unification viable?

API Proposal

No response

Firebase Product(s)

Crashlytics

luqas11 avatar Jun 18 '24 18:06 luqas11

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Jun 18 '24 18:06 google-oss-bot

Any updates on this issue?

willywagtail avatar Jul 08 '24 08:07 willywagtail

This is an expected behaviour and we do realize the discrepancy. An alternative is when logging non-fatal, you can added additional userInfo as extra parameter. UserInfo will attach to custom key values and it is on event base rather on session base. For API reference is here.

themiswang avatar Nov 26 '24 20:11 themiswang