Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an Error Page #6856

Merged
merged 32 commits into from
Jan 14, 2022
Merged

Added an Error Page #6856

merged 32 commits into from
Jan 14, 2022

Conversation

mananjadhav
Copy link
Collaborator

@mananjadhav mananjadhav commented Dec 21, 2021

Details

  • Added a generic error page.

Fixed Issues

$ #6552

Tests

  1. Tested the pages for different dimensions
  2. Tested the component by forcing an error

QA Steps

  1. Force an error (not sure how this will be on staging)
  2. Ensure that the new error page is shown.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web-error-page

Mobile Web

mweb-error-page

Desktop

desktop-error-page

iOS

ios-error-page

Android

android-error-page

@mananjadhav mananjadhav requested a review from a team as a code owner December 21, 2021 19:36
@MelvinBot MelvinBot requested review from parasharrajat and roryabraham and removed request for a team December 21, 2021 19:36
@mananjadhav
Copy link
Collaborator Author

@roryabraham @parasharrajat While most of the work is done, I need help with the following to close this. Can you please help?

  1. Need to verify the design/colors, etc. if they're correct. Especially the fontsize of the title
  2. I've seen other places we use blue for links but in the error page design, it is black. I've kept it blue for now, let me know if it has to be changed.
  3. Need to validate the Spanish translations
  4. I am not sure how do I refresh the user to the same URL. Do we have any reference code where we have done this?
  5. How will the QA force an error to load this component? Need to update the QA steps accordingly.

@parasharrajat
Copy link
Member

Need to verify the design/colors, etc. if they're correct. Especially the fontsize of the title
I've seen other places we use blue for links but in the error page design, it is black. I've kept it blue for now, let me know if it has to be changed.

cc: @Expensify/design

I am not sure how do I refresh the user to the same URL. Do we have any reference code where we have done this?

Web => location.reload.
Android => you may have to restart the main activity. Add a small native method which we can call here.

How will the QA force an error to load this component? Need to update the QA steps accordingly.

I think the best would be to mark it as No QA.

src/components/GenericErrorView/ErrorBodyText/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
src/components/GenericErrorView/index.js Outdated Show resolved Hide resolved
@parasharrajat
Copy link
Member

Android => you may have to restart the main activity. Add a small native method which we can call here.

may be utilized react-navigation for this. Reset the navigation state and redirect the user to the home Route.

@mananjadhav
Copy link
Collaborator Author

mananjadhav commented Dec 21, 2021

may be utilized react-navigation for this. Reset the navigation state and redirect the user to the home Route.

I guess the requirement is to reload on the same route and not home route. I'll check what are the options.

@parasharrajat
Copy link
Member

Then you can redirect to the same route just reset the state.

@mananjadhav
Copy link
Collaborator Author

Then you can redirect to the same route just reset the state.

I've picked the current route by adding a function. Is that the right direction?

@shawnborton
Copy link
Contributor

Looks pretty good to me, but looping in @megankelso since she worked on the designs for this.

@roryabraham
Copy link
Contributor

Minor piece of feedback for @mananjadhav – when you address feedback, feel free to resolve the reviewer's comment threads to make it easier for other reviewers to scan the issue and pick out any threads with active discussion.

@mananjadhav
Copy link
Collaborator Author

mananjadhav commented Dec 22, 2021

Noted @roryabraham. I generally used to put a 👍 emoji on completion. Will resolve next time PR onwards.

@mananjadhav
Copy link
Collaborator Author

@roryabraham @parasharrajat I've tried finding a react-navigation solution but that doesn't seem to be working. I was wondering if we should even rely on react-navigation. I forced an error on ReportScreen and if I use the navigationRef.current, it throws null error.

Can we use https://www.npmjs.com/package/react-native-restart for the native platforms, https://www.npmjs.com/package/electron-reload for desktop and location.reload for web platforms?

@roryabraham
Copy link
Contributor

I agree we shouldn't rely on react-navigation for the reload. Regarding your proposed alternate solution:

@mananjadhav
Copy link
Collaborator Author

Could we just use location.reload on desktop?

Missed that. Yeah we can use it.

@mananjadhav
Copy link
Collaborator Author

I've asked in the slack channel, but still went ahead to test the lib. It seems to work fine. Will change if I get any feedback to not use lib,

@mananjadhav mananjadhav dismissed stale reviews from parasharrajat and shawnborton via 9209388 January 12, 2022 20:03
@mananjadhav
Copy link
Collaborator Author

@roryabraham PR updated. Left with two comments - punctuation utility and button size prop.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Other than the one remaining thread I think this looks good.

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @roryabraham in version: 1.1.29-6 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@mvtglobally
Copy link

@mananjadhav @roryabraham @shawnborton @parasharrajat
Any suggestion on how can we trigged this error to QA?

@roryabraham
Copy link
Contributor

Ah, sorry this PR title should have been prefixed with [No QA]. Unless there's a bad "white screen" bug that's consistently reproducible on staging there's no way to QA this.

...unless... we could purposely introduce such a bug to QA this, then revert that PR 😈

@parasharrajat
Copy link
Member

I have a suggestion. Just try to run the QA for this on any crash issue. I think there is one for room details.

@roryabraham
Copy link
Contributor

I think there is one for room details.

Have a link?

@parasharrajat
Copy link
Member

@roryabraham
Copy link
Contributor

Thanks @parasharrajat, that's perfect! @mvtglobally for QA steps:

Web/Desktop/mWeb

  1. Follow the reproduction steps in New Room - "Uh-oh, something went wrong! error" after click on room details #7262
  2. Make sure the UI looks correct.
  3. Verify that it does not prompt you to open the page on web.

iOS/Android

  1. Same as web/desktop/mWeb, except verify that it does suggest opening the app on web, and includes a link.
  2. Click on the link, verify it takes you to the correct NewDot website (staging, if QA'ing on staging, production, if QA'ing on production).

@mananjadhav
Copy link
Collaborator Author

Thank you @parasharrajat @roryabraham for helping with this.

@mvtglobally
Copy link

@roryabraham @mananjadhav
Should sign out button fix the error?
Is this a separate issue or expected since we have a crash?

Upload.from.GitHub.for.iOS.MOV

@mvtglobally
Copy link

Also On IOS the page doesn't really display as app crashes. Expected? https://user-images.githubusercontent.com/43995119/149956996-295be13f-1109-499b-afba-8bb9c435411b.MOV

@mananjadhav
Copy link
Collaborator Author

I saw the video for iOS, it seems ti flashes for a second and then crashes. It shouldn't be related to the ErrorPage, but yeah let @roryabraham and @parasharrajat comment.

@parasharrajat
Copy link
Member

It seems that the error was thrown out of the Render tree and yeah that won't be caught by the current implementation. Should that be part of this issue?

@mvtglobally
Copy link

@roryabraham Should we log a new issue or just leave it as is

@roryabraham
Copy link
Contributor

@mvtglobally That's a separate issue, the scope of this PR was really just designing and implementing a generic error page. As long as the page displays correctly, I think other issues are out-of-scope. From what I can see in the videos, this looks to me like it's passing QA. I'm going to check it off on the checklist.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.30-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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.

6 participants