fix: dashboard empty when opened after scan completes#306
Open
ducky-duke wants to merge 1 commit intoharlan-zw:mainfrom
Open
fix: dashboard empty when opened after scan completes#306ducky-duke wants to merge 1 commit intoharlan-zw:mainfrom
ducky-duke wants to merge 1 commit intoharlan-zw:mainfrom
Conversation
The dashboard showed a blank page when opened after the scan finished. Three root causes: 1. payload.js was generated at server startup with empty reports and never regenerated. Reports were only included in CI/static mode. 2. The unctx async context was not available inside the worker-finished hook callback, so useUnlighthouse() returned a stale context with an empty worker when generateClient() was called. 3. In dynamic mode the client relied solely on WebSocket for data, but WebSocket doesn't replay past events for late-joining clients. Changes: - build.ts: always include completed reports in payload.js - cli.ts: regenerate payload after scan via worker-finished hook, passing the unlighthouse context explicitly to avoid unctx issue - state.ts: seed wsReports from payload data on module load; replace VueUse useFetch with native fetch for initial report loading - LighthouseThreeD.vue: add missing scanMeta import
👷 Deploy request for unlighthouse-crux-api pending review.Visit the deploys page to approve it
|
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.
Summary
The dashboard shows a blank page when opened after a scan finishes. This fixes three root causes:
payload.jsnever updated: Generated at server startup withreports: []and never regenerated. Reports were only included whenoptions.static === true(CI mode only). Now always includes completed reports.unctxcontext lost in async hook:useUnlighthouse()inside theworker-finishedhook returned a stale context with 0 reports. Fixed by passing theunlighthousecontext explicitly togenerateClient().wsReportsfrompayload.json load and uses nativefetch()instead of VueUse'suseFetchcomposable for reliable initial data loading.LighthouseThreeD.vueusedscanMetawithout importing it, causing aReferenceError.Changed files
packages/core/src/build.tspayload.jspackages/cli/src/cli.tsworker-finishedhookpackages/client/logic/state.tswsReportsfrom payload + use nativefetchpackages/client/components/LighthouseThreeD.vuescanMetaimport