Closed joshfarrant closed 7 years ago
Only potential issue with this, which I hadn't previously considered, is that you could end up pushing sensitive data, eg.
{
type: 'USER_LOGIN',
payload: {
username: 'joebloggs',
password: '123'
}
}
Definitely don't want that in Sentry! In hindsight, this could be a good enough reason in itself to not implement this, assuming there's no way to filter this out.
This is a great idea, unfortunately there are some "gottchas". The biggest limitation is that Sentry won't accept reports with too much data. If you attach every action (some of which might contain entire API responses) you can quickly end up in a place where exceptions are not actually stored, since Sentry returns 400 when Raven tries to report it.
Also, the data
attribute must be a flat object. You can get around this with something like JSON.stringify()
but it's kinda a hack.
If this is still something you want to pursue, I've added a new option breadcrumbDataFromAction
(see the README for docs) which should let you achieve your goal. Basically it lets you define a function which generates the breadcrumb data
object.
There was a similar conversation over here: https://github.com/ngokevin/redux-raven-middleware/issues/24
Thanks for looking into this!
Just a thought that could potentially be a useful addition - It's quite likely that a lot of people using Redux will also be using the flux-standard-actions standard for structuring their actions.
It could be useful to include the action's
payload
property (if it exists) in thedata
property of Raven's breadcrumb to help add a bit more context to actions in the breadcrumb in Sentry.This could also be extended to including all of an action's properties (apart from
type
) in the breadcrumb'sdata
, which would then mean that all actions (in whatever format) could be passed through to Sentry and examined.Interested to hear your thoughts on this!