Skip to content

feat(browser): Classify bfcache not-restored reasons by category and actionability#22398

Closed
logaretm wants to merge 1 commit into
awad/bfcache-integrationfrom
awad/bfcache-reason-classification
Closed

feat(browser): Classify bfcache not-restored reasons by category and actionability#22398
logaretm wants to merge 1 commit into
awad/bfcache-integrationfrom
awad/bfcache-reason-classification

Conversation

@logaretm

@logaretm logaretm commented Jul 20, 2026

Copy link
Copy Markdown
Member

Adds browser.bfcache.reason_category (page_lifecycle / network / storage / realtime / embed / browser / unknown) and a browser.bfcache.actionable boolean to each browser.bfcache.not_restored metric, from a small SDK-side mapping of the known reason strings.

The raw notRestoredReasons strings are useful but opaque and, as Chrome explicitly warns, subject to change. Bucketing them into durable categories plus a "can the developer fix this?" flag makes a miss answer both "why" and "what to do" on a dashboard, without pinning the dashboard to volatile strings. Unrecognized reasons degrade to unknown / non-actionable, so a new browser reason never silently breaks grouping.

The mapping is unit-tested, and the e2e app asserts the category/actionable pair end-to-end against the real reasons it can reproduce: unload → page_lifecycle, WebSocket → realtime, IndexedDB versionchange → storage, no-store → network, and the privacy-masked reason → embed / non-actionable.

Builds on #22397.

@logaretm logaretm closed this Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.75 kB - -
@sentry/browser - with treeshaking flags 26.18 kB - -
@sentry/browser (incl. Tracing) 46.56 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.37 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.36 kB - -
@sentry/browser (incl. Tracing, Replay) 85.83 kB -0.02% -11 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.46 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.55 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 103.2 kB -0.01% -9 B 🔽
@sentry/browser (incl. Feedback) 44.93 kB - -
@sentry/browser (incl. sendFeedback) 32.55 kB - -
@sentry/browser (incl. FeedbackAsync) 37.69 kB - -
@sentry/browser (incl. Metrics) 28.83 kB - -
@sentry/browser (incl. Logs) 29.05 kB - -
@sentry/browser (incl. Metrics & Logs) 29.76 kB - -
@sentry/react 29.54 kB - -
@sentry/react (incl. Tracing) 48.84 kB - -
@sentry/vue 33.17 kB - -
@sentry/vue (incl. Tracing) 48.52 kB - -
@sentry/svelte 27.78 kB - -
CDN Bundle 30.14 kB - -
CDN Bundle (incl. Tracing) 48.53 kB - -
CDN Bundle (incl. Logs, Metrics) 31.73 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.83 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.98 kB -0.02% -9 B 🔽
CDN Bundle (incl. Tracing, Replay) 86.04 kB -0.02% -10 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.34 kB -0.02% -10 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 91.84 kB -0.01% -9 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.11 kB -0.02% -10 B 🔽
CDN Bundle - uncompressed 89.88 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.73 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.71 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.32 kB -0.02% -25 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.94 kB -0.01% -25 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.9 kB -0.01% -25 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.64 kB -0.01% -25 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.6 kB -0.01% -25 B 🔽
@sentry/nextjs (client) 51.36 kB - -
@sentry/sveltekit (client) 46.99 kB - -
@sentry/core/server 80.13 kB -0.16% -126 B 🔽
@sentry/core/browser 66.56 kB -0.2% -132 B 🔽
@sentry/node-core 63.21 kB +0.01% +1 B 🔺
@sentry/node 125.66 kB -0.06% -72 B 🔽
@sentry/node (incl. diagnostics channel injection) 149.41 kB -0.08% -106 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB -0.01% -2 B 🔽
@sentry/node/light 51.32 kB - -
@sentry/node - without tracing 74.92 kB +0.01% +1 B 🔺
@sentry/aws-serverless 84.15 kB - -
@sentry/cloudflare (withSentry) - minified 197.51 kB - -
@sentry/cloudflare (withSentry) 485.87 kB - -

View base workflow run

@logaretm

Copy link
Copy Markdown
Member Author

Closing because I think the info here can drift, so the SDK should not collect these but could be inferred on the product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant