diff --git a/docs/sentry.md b/docs/sentry.md index 1fc232429..27a1ae607 100644 --- a/docs/sentry.md +++ b/docs/sentry.md @@ -20,25 +20,42 @@ Three independent checks. An event is dropped if **any** of them match. Sentry treats each string as a **substring**. `Failed to fetch` also matches `Failed to fetch dynamically imported module`. -| You will stop seeing | Typical cause | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| Handled unknown error | Sentry could not extract a real Error from Angular | -| Non-Error promise rejection captured… | A promise rejected with `undefined` / `null` / a plain object | -| no elements in sequence | RxJS `EmptyError` (empty observable used with `first()` / `single()`) | -| ResizeObserver loop… | Browser layout warning | -| Failed to fetch | Chrome/Edge: offline, CORS, blocked request, including `api.osf.io` / `addons.osf.io` | -| Load failed | Safari equivalent of failed fetch (including `files.osf.io`) | -| NetworkError when attempting to fetch resource | Firefox equivalent of failed fetch | -| Failed to fetch dynamically imported module / error loading dynamically imported module / Importing a module script failed / ChunkLoadError / Loading chunk … failed | User has an old tab open after a frontend deploy | -| AbortError / The operation was aborted / The user aborted a request | Request cancelled (navigation, timeout, user abort) | +| You will stop seeing | Typical cause | +| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| Handled unknown error | Sentry could not extract a real Error from Angular | +| Non-Error promise rejection captured… | A promise rejected with `undefined` / `null` / a plain object | +| no elements in sequence | RxJS `EmptyError` (empty observable used with `first()` / `single()`) | +| ResizeObserver loop… | Browser layout warning | +| Failed to fetch | Chrome/Edge: offline, CORS, blocked request, including `api.osf.io` / `addons.osf.io` | +| Load failed | Safari equivalent of failed fetch (including `files.osf.io`) | +| NetworkError when attempting to fetch resource | Firefox equivalent of failed fetch | +| Failed to fetch dynamically imported module | Chrome/Edge: lazy chunk failed to load (often an old tab after deploy) | +| error loading dynamically imported module | Firefox: same lazy-chunk failure | +| Importing a module script failed | Safari: same lazy-chunk failure | +| ChunkLoadError / Loading chunk … failed | Webpack/Vite chunk load failure after deploy | +| AbortError / The operation was aborted / The user aborted a request | Request cancelled (navigation, timeout, user abort) | +| Beacon is not defined | Extension or third-party script; not OSF (`navigator.sendBeacon` is a different API) | ### 2. Script URL (`denyUrls`) -Errors whose stack frames come from a **browser extension**, not from OSF code (`chrome-extension://`, `moz-extension://`, `safari-extension://`, and similar). +Errors whose stack frames come from a **browser extension**, not from OSF code: + +- `extensions/` +- `chrome://` +- `chrome-extension://` +- `moz-extension://` +- `safari-extension://` +- `safari-web-extension://` +- `ms-browser-extension://` ### 3. HTTP status below 500 (`beforeSend`) -If the event is an HTTP response (Angular `HttpErrorResponse`, the message `Http failure response for …: 410`, or `Object captured as exception` with HTTP fields) and the status is **0–499**, it is dropped. +If the event is an HTTP response and the status is **0–499**, it is dropped. Status is read from: + +- Angular `HttpErrorResponse` (including nested `ngOriginalError` / `rejection` / `cause`) +- `Http failure response for …: 410` +- `Server returned code 404 with body "…"` +- `Object captured as exception with keys: …` or `Non-Error exception captured with keys: …` when the keys look like an HTTP response | Status | Meaning | Dropped? | | ------------- | -------------------------------------- | ------------------- | diff --git a/src/app/core/helpers/sentry-filter.helper.ts b/src/app/core/helpers/sentry-filter.helper.ts index 9bd53031f..230c11b9d 100644 --- a/src/app/core/helpers/sentry-filter.helper.ts +++ b/src/app/core/helpers/sentry-filter.helper.ts @@ -17,6 +17,7 @@ export const SENTRY_IGNORE_ERRORS: (string | RegExp)[] = [ 'The user aborted a request', 'ChunkLoadError', /Loading chunk [\w.-]+ failed/, + 'Beacon is not defined', ]; export const SENTRY_DENY_URLS: (string | RegExp)[] = [