-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Add shouldHandleDiagnosticsChannelError
option to fastifyIntegration
#16845
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
base: develop
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Race Condition in Error Handling
The test has a race condition. The errorEventPromise.then(() => { test.fail(); })
callback is not awaited, allowing test.fail()
to execute asynchronously after the test has completed. This can lead to flaky tests where an incorrectly captured error is not reported. The promise handler should be awaited with a timeout or Promise.race()
should be used.
dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts#L36-L39
sentry-javascript/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts
Lines 36 to 39 in f513f8a
errorEventPromise.then(() => { | |
test.fail(); | |
}); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Yeah good point. I wouldn't mind changing the name to |
shouldHandleError
option to fastifyIntegration
shouldHandleDiagnosticsChannelError
option to fastifyIntegration
31d50b1
to
fc2159e
Compare
Resolves: #16819
This requires the Fastify integration to be manually added while initialising Sentry.
Though I think this may be a bit confusing for Fastify v4/v3
setupFastifyErrorHandler
users, as this will be a no-op in these cases, maybe we can change the name toshouldHandleDiagnosticsChannelError
or something like that? 🤔