Skip to content
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

Improve the handling of leaveBreadcrumb's metadata property when it cannot be serialized #1164

Closed
hitsvilleusa opened this issue Aug 11, 2021 · 3 comments
Labels
released This feature/bug fix has been released

Comments

@hitsvilleusa
Copy link

hitsvilleusa commented Aug 11, 2021

Description

We had breadcrumbs that were not showing up in our error reports, which wasn't discovered until we randomly saw

unable to serialize breadcrumb: not a valid JSON object

in our logs.

The problem was a simple fix ... we were sending a value from an enumerated type, and adding a description, or rawValue, or String(describing: value) all would do the trick. This led to being a bit more robust in our solution and before sending the payload to bugsnag, we converted any non serializable values using String(describing: value).

Describe the solution you'd like
I would like it if we didn't have to pre-process the metadata that we sent to leaveBreadcrumb. Being a little smarter about how to serialize data would be a win, or even if the compiler told us that we needed to fix it on the calling end, would have been a win.

Describe alternatives you've considered
I built out solutions to leverage the compiler and to just convert at runtime when there was an issue, and found that the runtime change was less disruptive overall.

Additional context

@johnkiely1
Copy link
Member

Hi @hitsvilleusa,

We're going to take a look into this to see what we can do to improve it. We will keep you updated here. Thanks.

@johnkiely1 johnkiely1 added backlog We hope to fix this feature/bug in the future bug Confirmed bug labels Aug 13, 2021
@nickdowell
Copy link
Contributor

@yousif-bugsnag
Copy link
Contributor

This has now been fixed in v6.12.2 🎉

@yousif-bugsnag yousif-bugsnag added released This feature/bug fix has been released and removed bug Confirmed bug backlog We hope to fix this feature/bug in the future labels Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

4 participants