Notifications: report standalone widget errors to Sentry#111825
Draft
StevenDufresne wants to merge 1 commit into
Draft
Notifications: report standalone widget errors to Sentry#111825StevenDufresne wants to merge 1 commit into
StevenDufresne wants to merge 1 commit into
Conversation
The wp-admin notifications widget had no error reporting, so boot failures and render crashes surfaced only as an endless spinner with no signal on our side. Add Sentry to the standalone app, capture the known silent failure points, and show a recoverable fallback instead of a frozen spinner. - Add a small Sentry wrapper (src/lib/sentry); reuse the shared Calypso DSN, tag events as the wp-admin notifications surface. captureException is a no-op until initSentry runs, so the shared REST client stays silent on surfaces that don't opt in (old panel, in-Calypso popover). - Wire init into the standalone-app boot; catch the createClient() rejection (previously unhandled) and the swallowed tracks/locale catches. - Add an error boundary with a fallback (message + reload) so a render crash is reported instead of unmounting to a dead spinner. - Report the first top-window getNotes() failure of a streak — the path that retries forever without ever clearing the loading state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
Contributor
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
apps/notifications/src/lib/sentry.ts) — reuses the shared Calypso DSN and tags events as the wp-admin notifications surface.captureExceptionis a no-op untilinitSentryruns, so the shared REST client stays silent on surfaces that don't opt in (the old panel, the in-Calypso popover).standalone-appboot; catch the previously-unhandledcreateClient()rejection and the swallowed tracks/locale catches.getNotes()failure of a streak — the path that retries forever without ever clearing the loading state.Why are these changes being made?
The wp-admin notifications widget shipped with no error reporting, so the recent redesign's failure modes (a hung boot, a render crash, a stuck fetch) reached users only as an endless spinner with zero signal on our side. This makes the next occurrence observable and gives users a way to recover. It is instrumentation, not the root-cause fix — it lets us confirm which trigger is actually firing in production.
Testing Instructions
yarn test-apps apps/notifications— new suites for the Sentry wrapper and the error boundary pass (44 tests total).apps/notificationstypechecks and lints clean.Notes / follow-ups
Pre-merge Checklist
🤖 Generated with Claude Code