Ma77Ball opened a new pull request, #5847:
URL: https://github.com/apache/texera/pull/5847

   ### What changes were proposed in this PR?
   - Add GlobalErrorHandler (implements Angular ErrorHandler), registered as 
the global ErrorHandler in app.module.ts.
   - handleError reloads the page once on a chunk-load failure (ChunkLoadError, 
"Loading chunk ... failed", or a failed dynamic import), guarded by a 
sessionStorage timestamp (10s window) so a genuinely missing chunk cannot cause 
a reload loop; all other errors delegate to Angular's default handler.
   - Chunk detection lives in a pure exported isChunkLoadError(error) function 
so it is unit-testable in isolation.
   ### Any related issues, documentation, discussions?
   Closes: #5837
   ### How was this PR tested?
   - Run `yarn test --include='**/global-error-handler.service.spec.ts'` from 
frontend/, expect 5 passing cases: isChunkLoadError true for chunk errors and 
false for generic/TypeError/null; handleError reloads once and records the 
guard, does not reload again within the window, and does not reload on a 
non-chunk error.
   - Manual: load the app, in DevTools block a chunk request URL (Network, 
Block request URL) and trigger a navigation that loads it, expect a single 
automatic reload rather than a broken view; trigger it again immediately and 
expect no reload loop.
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.8 in compliance with ASF


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to