Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/sentry/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export function shouldDropClientEvent(event: ErrorEvent): boolean {
const text = getEventErrorText(event)

if (
text.includes("Cannot read properties of undefined (reading 'env')") ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The new error filter for "Cannot read properties of undefined (reading 'env')" is too generic and lacks a !hasAppStackFrame guard, potentially suppressing legitimate application errors.
Severity: MEDIUM

Suggested Fix

Guard the new filter with a !hasAppStackFrame check to ensure it only applies to non-application code, which is consistent with other filters in the function. Alternatively, make the filter more specific to Dexie errors by checking for additional context.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/lib/sentry/policy.ts#L374

Potential issue: The new filter added to `shouldDropClientEvent` to drop events with the
message `"Cannot read properties of undefined (reading 'env')"` is overly broad. Because
it lacks a `!hasAppStackFrame` guard, it will suppress any error with this message, even
if it originates from the application's own code. This violates the function's
documented purpose of allowing app-frame errors through for debugging. While intended to
filter noise from Dexie/IndexedDB based on an issue
([WEBSITE-36](https://raidhub.sentry.io/issues/integer_issue_id)), this generic filter
could inadvertently hide real bugs in the application that happen to produce the same
error message.

Did we get this right? 👍 / 👎 to inform future reviews.

text.includes("Database deleted by request of the user") ||
text.includes("OpenFailedError") ||
text.includes("Connection to Indexed Database server lost") ||
Expand Down
Loading