Repository navigation
feat(rum): Collect back/forward navigation type and bfcache not-restored reasons - #5288
Draft
guillaumerob-dd wants to merge 1 commit into
Draft
guillaumerob-dd wants to merge 1 commit into
guillaumerob-dd wants to merge 1 commit into
Conversation
|
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. |
This branch has not been deployed
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.
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: