I'm still digging into it, but I've encountered an issue when using a scope and scope.addEventProcessor where neither captureEvent nor sendEvent seem to never get called. (We're using it to parse Koa requests via Sentry.Handlers.parseRequest in our implementation.)
If anyone happens to have an inkling of what might be going on, any insight would be greatly appreciated! I'll continue to try sorting it out, but in the mean time, as a starting point here's a test case that fails if it happens to be useful for anyone wandering into this as well. Simply removing the call to addEventProcessor allows it to pass:
test('plays well with event processors', async function () {
const err = new Error('sentry test kit is awesome!');
Sentry.withScope(async scope => {
scope.addEventProcessor(event => Sentry.Handlers.parseRequest(event, koaCtx.request));
Sentry.captureException(err);
});
await waitForExpect(() => expect(testkit.reports()).toHaveLength(1));
expect(testkit.reports()[0].exception).toMatchObject({
values: [{ type: 'Error', value: 'sentry test kit is awesome!' }]
});
})
I'm still digging into it, but I've encountered an issue when using a scope and
scope.addEventProcessor
where neithercaptureEvent
norsendEvent
seem to never get called. (We're using it to parse Koa requests viaSentry.Handlers.parseRequest
in our implementation.)If anyone happens to have an inkling of what might be going on, any insight would be greatly appreciated! I'll continue to try sorting it out, but in the mean time, as a starting point here's a test case that fails if it happens to be useful for anyone wandering into this as well. Simply removing the call to
addEventProcessor
allows it to pass: