glific-frontend icon indicating copy to clipboard operation
glific-frontend copied to clipboard

Added error boundary for react

Open mdshamoon opened this issue 2 years ago • 4 comments

Summary

Added error boundary for react.

Steps to test:

Add a constant in any file
const test: any= {}

now try to nested check for that object

if(test.button.show === true)

It will show the error boundary

mdshamoon avatar Mar 30 '22 06:03 mdshamoon

🚀 Deployed on https://deploy-preview-1991--fervent-hypatia-766178.netlify.app

github-actions[bot] avatar Mar 30 '22 06:03 github-actions[bot]

Codecov Report

Base: 70.01% // Head: 69.97% // Decreases project coverage by -0.04% :warning:

Coverage data is based on head (6442ace) compared to base (05645ac). Patch coverage: 47.05% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1991      +/-   ##
==========================================
- Coverage   70.01%   69.97%   -0.05%     
==========================================
  Files         238      239       +1     
  Lines        8082     8099      +17     
  Branches     1740     1741       +1     
==========================================
+ Hits         5659     5667       +8     
- Misses       1838     1846       +8     
- Partials      585      586       +1     
Impacted Files Coverage Δ
...c/routes/AuthenticatedRoute/AuthenticatedRoute.tsx 76.47% <ø> (ø)
src/components/errorboundary/ErrorBoundary.tsx 47.05% <47.05%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Mar 30 '22 07:03 codecov[bot]



Test summary

172 0 0 0Flakiness 1


Run details

Project Glific
Status Passed
Commit 94330c71d9 ℹ️
Started Jan 3, 2023 11:14 AM
Ended Jan 3, 2023 11:32 AM
Duration 17:25 💡
OS Linux Ubuntu - 22.04
Browser Electron 89

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/staffmanagement/StaffManagement.spec.ts Flakiness
1 Staff Management > should have require field

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

cypress[bot] avatar Mar 30 '22 07:03 cypress[bot]

if(test.button.show === true)

Yes. Its happening due to the react-scripts-issue that I told you earlier. An iframe blocks the entire screen https://github.com/facebook/create-react-app/issues/11773 I have added a fix written in this issue. Setting react-error-overlay to v6.0.9. This works but let's upgrade reacts-scripts soon

mdshamoon avatar May 05 '22 07:05 mdshamoon

@mdshamoon

We might need to change the implementation as we are using the latest React.

kurund avatar Nov 28 '22 22:11 kurund

@mdshamoon

We might need to change the implementation as we are using the latest React.

Based on the documentation React doesnt have anything new for Error Boundary in the latest version. It uses the same approach of the class component. Please let me know if I am missing something here.

mdshamoon avatar Nov 30 '22 17:11 mdshamoon