diff --git a/src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.tsx b/src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.tsx index 5bd350d0d4f..e4c03e96aa0 100644 --- a/src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.tsx +++ b/src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.tsx @@ -50,8 +50,7 @@ export class RecoverableRenderErrorBoundary extends React.Component { expect(isLazyChunkLoadError(await settled)).toBe(true) expect(window.sessionStorage.getItem(RELOAD_GUARD_KEY)).toBeNull() }) + + it('still surfaces ordinary evaluation bugs after a never-landed reload attempt', async () => { + const error = new Error('render bug from lazy module evaluation') + const settled = loadLazyWithRetry(() => Promise.reject(error), { retries: 0 }).catch( + (rejection: unknown) => rejection + ) + await vi.advanceTimersByTimeAsync(0) + await vi.advanceTimersByTimeAsync(RELOAD_SETTLE_GRACE_MS + 1) + + // Containment is only for known dynamic-import failures; real bugs must still report. + expect(await settled).toBe(error) + expect(isLazyChunkLoadError(error)).toBe(false) + }) }) diff --git a/src/renderer/src/lib/lazy-with-retry.ts b/src/renderer/src/lib/lazy-with-retry.ts index 0ed7237d1f7..77650b67ded 100644 --- a/src/renderer/src/lib/lazy-with-retry.ts +++ b/src/renderer/src/lib/lazy-with-retry.ts @@ -228,7 +228,7 @@ export async function loadLazyWithRetry( // A sibling failing under a pending reload must not clear the guard, and an // unrelated failure must not clear a guard it did not set. if (!reloadRequestInFlight && isKnownDynamicImportFailure(lastError)) { - // Record the veto beside the resulting report before the ring can evict it. + // Record the veto before the ring can evict it; the failure is then contained. clearChunkReloadGuard() recordReloadBreadcrumb( 'lazy_chunk_reload_vetoed',