Skip to content

Commit 1004c70

Browse files
committed
Comment describing why we prevent Events from being sent with @Miniflare in the frame
1 parent 34d1918 commit 1004c70

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.changeset/breezy-steaks-visit.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: We want to prevent any user created code from sending Events to Sentry,
6+
which can be captured by `uncaughtExceptionMonitor` listener.
7+
Miniflare code can run user code on the same process as Wrangler,
8+
so we want to return `null` if `@miniflare` is present in the Event frames.

packages/wrangler/src/reporting.ts

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ export function initReporting() {
3030
// from their worker during development
3131
return null;
3232
},
33+
/**
34+
* We want to prevent any user created code from sending Events to Sentry,
35+
* which can be captured by "uncaughtExceptionMonitor" listener.
36+
* Miniflare code runs on the same process as Wrangler, so we want to return `null`
37+
* if "@miniflare" is present in the Event frames.
38+
*/
3339
beforeSend: (event) => {
3440
return !event.exception?.values?.some((value) =>
3541
value.stacktrace?.frames?.some((frame) =>

0 commit comments

Comments
 (0)