Skip to content

Commit 3aea215

Browse files
committed
fix: filtered out plugin disabled sentry events to avoid exceeding quota for events we dont need
1 parent 3c19525 commit 3aea215

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/main.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,40 @@ if (typeof import.meta.env.VITE_MAILCHIMP_LINK === 'string') {
9898
tracingOrigins: ['localhost', 'powerup.activity-timer.com', /^\//]
9999
})
100100
],
101-
tracesSampleRate: 0.0
101+
tracesSampleRate: 0.0,
102+
beforeSend(event, hint?) {
103+
// Ignore "Plugin disabled on board" errors
104+
const error = hint?.originalException;
105+
if (
106+
error &&
107+
typeof error === 'string' &&
108+
error.includes('PostMessageIO:PluginDisabled')
109+
) {
110+
return null;
111+
}
112+
113+
// Also check error messages
114+
if (
115+
event.message &&
116+
event.message.includes('PostMessageIO:PluginDisabled')
117+
) {
118+
return null;
119+
}
120+
121+
// Check exception values
122+
if (event.exception?.values) {
123+
for (const exception of event.exception.values) {
124+
if (
125+
exception.value?.includes('PostMessageIO:PluginDisabled') ||
126+
exception.value?.includes('Plugin disabled on board')
127+
) {
128+
return null;
129+
}
130+
}
131+
}
132+
133+
return event;
134+
}
102135
});
103136
}
104137

0 commit comments

Comments
 (0)