Skip to content

fix: stop reporting expected errors to sentry - #3735

Merged
kolaente merged 3 commits into
mainfrom
fix-sentry-noise
Sep 4, 2026
Merged

fix: stop reporting expected errors to sentry#3735
kolaente merged 3 commits into
mainfrom
fix-sentry-noise

Conversation

@tink-bot

@tink-bot tink-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Three classes of expected errors flood Sentry. None are bugs. All still reach user through UI or logs.

Token refresh (FRONTEND-OSS-2FB/2FR/2GY/2HS/2JQ, ~35k events). auth.ts wraps failed /user/token/refresh in new Error('Error renewing token: ', {cause: e}). Cause is AxiosError 401 — expired session, expected. Old beforeSend dropped bare AxiosError only, so wrapper slipped through. New shouldDropEvent() walks cause chain (depth cap 10, survives cycles).

Stale chunks (FRONTEND-OSS-1QF/2GD/2FS). Old index.html open, deploy changed asset hashes, dynamic import 404s. Now handleChunkLoadErrors() catches Vite vite:preloadError and reloads page; sessionStorage timestamp caps one reload per 60s, so second failure propagates instead of looping. beforeSend also drops chunk-load messages that arrive by other paths.

Webhook deliveries (API-OSS-2Y, ~4.4k events). User webhook returning 404 forever poisons a message per event; poison logger sent every one to Sentry. WebhookDeliveryListener now sets events.MetadataSkipErrorReporting before returning a delivery error — watermill poison middleware republishes same message, so flag survives. Retries and poisoning unchanged, log.Errorf unchanged. Errors before delivery (unmarshal, DB lookup, nil payload) are ours and still reported.

How to verify

  1. Log in, then invalidate the session (clear the refresh cookie) and trigger a token refresh.

  2. Expected: the 401 is handled as before (redirect to login), and no Sentry event is captured for it.

  3. Before this PR: an Error renewing token: event was sent to Sentry.

  4. Create a project webhook pointing at a URL that returns 404, then update a task in that project.

  5. Expected: the API log still shows webhook N returned non-success status 404 and the message is retried and parked in the poison queue, but no Sentry exception is captured.

@github-actions github-actions Bot added area/auth Login, OIDC, LDAP, SAML, TOTP/2FA, PKCE, SCIM, sessions, password area/webhooks Webhook delivery, payloads, event types labels Sep 4, 2026
@kolaente
kolaente enabled auto-merge (rebase) September 4, 2026 21:00
@github-actions github-actions Bot added the auto-merge PR has GitHub auto-merge enabled label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-3735.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-3735 latest
https://sha-80888aec8e57ed893ee65ed0958189e4ddf0cb17.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-80888aec8e57ed893ee65ed0958189e4ddf0cb17 80888ae

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-3735 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-3735
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3735

Last updated for commit 80888ae

@kolaente
kolaente merged commit 8dcd71d into main Sep 4, 2026
45 checks passed
@kolaente
kolaente deleted the fix-sentry-noise branch September 4, 2026 21:27
@github-actions github-actions Bot removed the auto-merge PR has GitHub auto-merge enabled label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Login, OIDC, LDAP, SAML, TOTP/2FA, PKCE, SCIM, sessions, password area/webhooks Webhook delivery, payloads, event types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants