Skip to content

feat(rum): Collect back/forward navigation type and bfcache not-restored reasons - #5288

Draft
guillaumerob-dd wants to merge 1 commit into
mainfrom
guillaume.roboam/bfcache-not-restored-reasons
Draft

guillaumerob-dd wants to merge 1 commit into
mainfrom
guillaume.roboam/bfcache-not-restored-reasons

Conversation

@guillaumerob-dd

Copy link
Copy Markdown

Problem

RUM reports bf_cache views when a page is restored, but nothing about the back/forward navigations that were not restored: they show up as plain initial_load views. An application can't tell how many back/forward navigations it misses, or why, so it can't fix them.

Chrome exposes both on the navigation entry: PerformanceNavigationTiming.type and, since Chrome 123, notRestoredReasons.

Fix

trackNavigationTimings.ts: read type and notRestoredReasons from the navigation entry; the reasons of embedded frames are flattened with the page's (deduplicated), since they block the cache too.
viewCollection.ts: send them as view.navigation_type and view.not_restored_reasons on the initial view.
performanceObservable.ts, rawRumEvent.types.ts: types for the new entry fields and view attributes.
Not done in this PoC: the rum-events-format schema change, and the matching facets.
Test
yarn test:unit packages/browser-rum-core: 1847 passed, including a new spec for nested frame reasons.
yarn typecheck, eslint, prettier on the changed files.
In Chrome stable, the navigation entry of a back navigation that was not restored, as read by this code:

  • {"type":"back_forward","notRestoredReasons":{"reasons":[{"reason":"broadcastchannel-message"}],"children":[{"id":"intercom-frame","reasons":[],"children":[]}, …]}}
  • view.navigation_type: back_forward
  • view.not_restored_reasons: ["broadcastchannel-message"]

@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@thomas-lebeau thomas-lebeau changed the title ✨ [RUM] collect navigation type and back/forward cache not-restored r… feat(rum): Collect back/forward navigation type and bfcache not-restored reasons Nov 24, 2026

This branch has not been deployed

No deployments
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