Never accept notifications from sentry.
Closed this issue · 0 comments
xyy94813 commented
redux-sentry-middleware/src/main.js
Lines 19 to 40 in 844390b
The event processor created when creating redux sentry middleware has never been executed.
Do I need to configure some other things or Upgrade Redux?
I don't know if it is this reason:
if the last processor return null
, it will not to be executed.
And why not to manage scope in middleware?
function createSentryMiddleware(hub, options = {}) {
const {
breadcrumbDataFromAction = identity,
actionTransformer = identity,
stateTransformer = identity,
breadcrumbCategory = 'redux-action',
filterBreadcrumbActions = filter,
getUserContext,
getTags,
} = options;
return store => {
let lastAction;
return next => action => {
Sentry.configureScope(scope => {
const state = store.getState();
scope.setExtra('state', stateTransformer(state));
scope.setExtra('lastAction', actionTransformer(lastAction));
if (getUserContext) {
scope.setUser({
...scope.user,
...getUserContext(state),
});
}
if (getTags) {
Object.entries(getTags(state)).forEach(item => {
scope.setTag(...item);
});
}
});
if (filterBreadcrumbActions(action)) {
Sentry.addBreadcrumb({
category: breadcrumbCategory,
message: action.type,
level: 'info',
data: breadcrumbDataFromAction(action),
});
}
lastAction = action;
return next(action);
};
};
}
Version Info:
- Redux: 3.7.2
- redux-sentry-middleware: 0.0.12
- @sentry/browser: 4.4.2