Skip to content

Frontend: Improve Error Boundary Coverage. Closes #978#982

Merged
regulartim merged 3 commits intointelowlproject:developfrom
chauhan-varun:enhancement/error-boundary-coverage
Mar 10, 2026
Merged

Frontend: Improve Error Boundary Coverage. Closes #978#982
regulartim merged 3 commits intointelowlproject:developfrom
chauhan-varun:enhancement/error-boundary-coverage

Conversation

@chauhan-varun
Copy link
Copy Markdown
Contributor

@chauhan-varun chauhan-varun commented Mar 6, 2026

Description

This PR introduces improved error boundary coverage for the frontend application. It adds a reusable ErrorBoundary component and integrates it into major protected routes.

image image

Key changes:

  • ErrorBoundary.jsx: Created a reusable class component to catch runtime errors and display a fallback UI with "Reload" and "Home" options.
  • Full Route Protection: Extended coverage to all application routes (Home, Dashboard, Feeds, Login, Register, Logout, etc.) to ensure complete application robustness.
  • Optimized Nesting: Refactored Routes.jsx mapping logic to ensure ErrorBoundary wraps Suspense. This allows the application to catch both component runtime errors and chunk-loading failures (lazy-load errors).
  • Renamed Property: Renamed the control flag to withErrorBoundary (from hasErrorBoundary) to avoid ambiguity with internal React Router v7 properties as suggested by the maintainer.
  • Unit Tests: Implemented comprehensive tests in ErrorBoundary.test.jsx verifying error catching, fallback rendering, and console logging.

Related issues

closes #978

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also created a pull request in the docs repository.
  • Linter (Ruff) gave 0 errors.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

GUI changes

  • I have provided a screenshot of the result in the PR.
  • I have created new frontend tests for the new component or updated existing ones.

@chauhan-varun
Copy link
Copy Markdown
Contributor Author

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!

@regulartim
Copy link
Copy Markdown
Collaborator

Hey @chauhan-varun !

PR is ready for a review,

Will review it soon (might take a while).

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!

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.

@chauhan-varun
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! :)

@regulartim regulartim merged commit 6c7dc2b into intelowlproject:develop Mar 10, 2026
5 checks passed
@chauhan-varun chauhan-varun deleted the enhancement/error-boundary-coverage branch March 11, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants