| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The soft navigation web vitals tests hid the page right after the click. If Chrome delivered the soft-navigation entry after that, web-vitals reported CLS for the pageload instead and never finalized the soft navigation's metrics, so the test timed out. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
size-limit report 📦
|
Sorry, something went wrong.
| // The SDK's observer was registered first, so it is notified first. Resolving from a task after | ||
| // ours runs lets it handle the entry before the caller continues. | ||
| const observer = new PerformanceObserver(() => { | ||
| observer.disconnect(); | ||
| setTimeout(resolve, 0); | ||
| }); | ||
| observer.observe({ type: 'soft-navigation', buffered: true }); | ||
| }); | ||
| }); | ||
| /* oxlint-enable no-restricted-globals */ | ||
| } |
There was a problem hiding this comment.
Bug: The waitForSoftNavigation function lacks a timeout. If the browser doesn't emit a 'soft-navigation' entry, the test will hang until the global timeout, instead of failing quickly.
Severity: MEDIUM
Add a timeout to the waitForSoftNavigation function, similar to the pattern used in the hidePage function. A setTimeout can be used to reject the promise after a reasonable duration if no 'soft-navigation' entry is received, preventing the test from hanging.
Prompt for AI AgentReview the code at the location below. A potential bug has been identified by an AI agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not valid. Location: dev-packages/test-utils/src/page.ts#L88-L107 Potential issue: The `waitForSoftNavigation` function waits for a 'soft-navigation' `PerformanceEntry` from the browser, but it lacks a timeout or fallback mechanism. According to browser documentation, these entries are not guaranteed to be generated for every navigation. If an entry is not created for any reason (e.g., browser heuristics not met, a race condition, or a browser quirk), the promise will never resolve. This will cause the test to hang for the full test runner timeout (e.g., 30 seconds) instead of failing quickly. A similar function, `hidePage`, includes a `setTimeout` fallback to prevent this exact issue.
Did we get this right? 👍 / 👎 to inform future reviews.
Sorry, something went wrong.
There was a problem hiding this comment.
That's the point
Sorry, something went wrong.
There was a problem hiding this comment.
I like the util 👍
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The soft navigation web vitals tests hid the page right after the click. Chrome only delivers the soft-navigation entry once the new route has painted, so it can arrive after the page is hidden. web-vitals then reports CLS for the pageload, and never finalizes the soft navigation's metrics, so the test times out. This was flaky on develop, e.g. in this run, where vue-3 (latest) and vue-3 (vue-router 5) both timed out.
The tests now wait for the soft-navigation entry before calling hidePage, using a new waitForSoftNavigation helper in test-utils.