Frontend: Improve Error Boundary Coverage. Closes #978#982
Conversation
… protected application routes.
|
Hey @regulartim PR is ready for a review, I noticed the current npm and pip installs are quite slow. Would you be open to migrating to pnpm and uv to speed up local development and Docker builds? I'm happy to handle the migration if you're interested! |
|
Hey @chauhan-varun !
Will review it soon (might take a while).
Good idea. I already have a local branch testing uv and bun, but pnpm might actually be a better fit. Will probably merge the change after the next release. |
|
Thanks! Sounds good. Happy to wait for the review. I’d be happy to help with the pnpm migration whenever you decide to move forward |
regulartim
left a comment
There was a problem hiding this comment.
Hey @chauhan-varun ! Looks good! 👍
Is there a reason to not wrap all routes? Home, Login, Register, Logout, ChangePassword, etc. are excluded as far as I can see.
…expand coverage to more routes.
regulartim
left a comment
There was a problem hiding this comment.
Looks good, thank you! :)
Description
This PR introduces improved error boundary coverage for the frontend application. It adds a reusable
ErrorBoundarycomponent and integrates it into major protected routes.Key changes:
ErrorBoundary.jsx: Created a reusable class component to catch runtime errors and display a fallback UI with "Reload" and "Home" options.Routes.jsxmapping logic to ensureErrorBoundarywrapsSuspense. This allows the application to catch both component runtime errors and chunk-loading failures (lazy-load errors).withErrorBoundary(fromhasErrorBoundary) to avoid ambiguity with internal React Router v7 properties as suggested by the maintainer.ErrorBoundary.test.jsxverifying error catching, fallback rendering, and console logging.Related issues
closes #978
Type of change
Checklist
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
Ruff) gave 0 errors.GUI changes