mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-20 22:14:11 +00:00
Filter browser extension TypeError: Failed to fetch errors in Sentry
Extend sentryShouldDropExpectedNonActionableError to also drop TypeError: Failed to fetch events whose stack frames originate from browser extension content scripts. Extension frames are identified by filenames starting with app:/// or containing frame_ant. Fixes Sentry issue CONSUMER-APP-8B. Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
This commit is contained in:
parent
a787041ca7
commit
05f6d9a8fa
1 changed files with 21 additions and 1 deletions
|
|
@ -6,7 +6,13 @@ import * as Sentry from "@sentry/nextjs"
|
|||
|
||||
function sentryShouldDropExpectedNonActionableError(event: {
|
||||
message?: string
|
||||
exception?: { values?: Array<{ type?: string; value?: string }> }
|
||||
exception?: {
|
||||
values?: Array<{
|
||||
type?: string
|
||||
value?: string
|
||||
stacktrace?: { frames?: Array<{ filename?: string }> }
|
||||
}>
|
||||
}
|
||||
}): boolean {
|
||||
const patterns = [
|
||||
/user location is not supported/i,
|
||||
|
|
@ -18,6 +24,20 @@ function sentryShouldDropExpectedNonActionableError(event: {
|
|||
if (matches(event.message)) return true
|
||||
for (const ex of event.exception?.values ?? []) {
|
||||
if (matches(ex.value)) return true
|
||||
|
||||
// Drop TypeError: Failed to fetch errors originating from browser extension
|
||||
// content scripts (identified by app:/// URLs or frame_ant in stack frames).
|
||||
if (
|
||||
ex.type === "TypeError" &&
|
||||
/Failed to fetch/i.test(ex.value ?? "") &&
|
||||
ex.stacktrace?.frames?.some(
|
||||
(f) =>
|
||||
f.filename?.startsWith("app:///") ||
|
||||
f.filename?.includes("frame_ant"),
|
||||
)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue