feat(testing): smoke-test script + VITE_FORCE_BOOT_STALL gate
- App.tsx and main.tsx ErrorBoundary gate rendererReady() on VITE_FORCE_BOOT_STALL build env var. When set, the ping is suppressed so the main-process boot timer fires (exercising the renderer-stalled recovery path without hand-editing source). - vite-env.d.ts declares the env var type so TS doesn't complain. - scripts/smoke-recovery.sh automates scenarios 2 (bad URL → load-failed) and 4 (forced stall → renderer-stalled), grepping stderr for the [recovery] entered: ... lines added by the prior commit. Backs up and restores the user's instance-url.json. Manual scenarios documented in the script header.
This commit is contained in:
@@ -34,7 +34,12 @@ export function App() {
|
||||
// first commit; main owns "armed once" gating so duplicate calls (e.g.
|
||||
// ErrorBoundary path) are idempotent. Semantic: "renderer survived
|
||||
// render," NOT "data loaded." A spinner on screen counts as boot success.
|
||||
//
|
||||
// Gated on VITE_FORCE_BOOT_STALL so the smoke-test harness can build a
|
||||
// variant that intentionally never pings, exercising the renderer-stalled
|
||||
// recovery path without hand-editing source. Set 'true' / '1' to force stall.
|
||||
useEffect(() => {
|
||||
if (import.meta.env.VITE_FORCE_BOOT_STALL) return;
|
||||
if (typeof window.backspace?.rendererReady === 'function') {
|
||||
window.backspace.rendererReady();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ class ErrorBoundary extends React.Component<
|
||||
// Renderer is alive enough to show the fallback UI — disarm the boot timer.
|
||||
// Without this, the timer fires 20s after a caught render error and
|
||||
// overrides the in-app error UI with native recovery, which is wrong.
|
||||
// Gated on VITE_FORCE_BOOT_STALL so the smoke harness can suppress both
|
||||
// ping paths simultaneously when testing the renderer-stalled recovery path.
|
||||
if (import.meta.env.VITE_FORCE_BOOT_STALL) return;
|
||||
if (typeof window.backspace?.rendererReady === 'function') {
|
||||
window.backspace.rendererReady();
|
||||
}
|
||||
|
||||
Vendored
+7
@@ -1,5 +1,12 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_FORCE_BOOT_STALL?: string;
|
||||
}
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
||||
declare module '@sapphi-red/web-noise-suppressor/rnnoiseWorklet.js?url' {
|
||||
const url: string;
|
||||
export default url;
|
||||
|
||||
Reference in New Issue
Block a user