Closed cyberhck closed 6 years ago
Great idea, but it has some challenges. Breadcrumbs consist of three things. A message
(string), a category
(string) and data
(object).
More info here: https://docs.sentry.io/clients/javascript/usage/#recording-breadcrumbs
Currently this library sets the message to action.type
.
I looked into passing the entire action as data
but there are two limitations:
data
can only be one level deep. No nested objects. An action could easily have nested objects, so this won't work for our pirposes.we don't have to care about nested objects, we can just do a JSON.stringify()
like you said. We can attach that somehow, then I will curl the JSON endpoint, get the actions as an array, then we can use redux dev tools to replay the entire session, exactly the way user did, no surprises.
What's the size limitation on sentry? Do you happen to know about that?
Is it a limitation for one breadcrumb? or is it in total? And we only send action with payloads, not the entire state, entire state will be provided by sentry anyways.
@cyberhck I've added an option breadcrumbDataFromAction
to my alternative middleware raven-for-redux. See the documentation for how to use it.
Unfortunately, while ideally it would be possible to record all actions and use them to exactly recreate any user bug, I think in a real world application Sentry is not quite setup to achieve this. The combination of large action payloads and long-running applications with lots of dispatched actions, will probably eventually result in hitting Sentry's limitations.
However, if you have a specific type of application where you know this will not be a problem, hopefully breadcrumbDataFromAction
will allow you to do so.
It's sad that sentry has those limitations, with redux, bugfixing has never been easier, it's so awesome, user doesn't even have to report bug for us to be able to reproduce them. Maybe I'll look into sentry a bit more, maybe they have removed those limitations in a paid plan or something.
@cyberhck Here's some additional information about the size limitation from Sentry: https://github.com/getsentry/raven-js/issues/339
It looks like one option (if you're determined to get this to work) would be to run your own instance of Sentry.
right now, in breadcrumb, message is always
action.type
need to provide a configuration option, so that users can also sendaction
, instead of justaction.type
.The end goal here is to replay the bug report on our browser the exact same way user did, so reproducing the bug becomes really easy.