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

App sporadically crashes #682

Closed
1 task
j08lue opened this issue Sep 28, 2023 · 3 comments
Closed
1 task

App sporadically crashes #682

j08lue opened this issue Sep 28, 2023 · 3 comments
Assignees

Comments

@j08lue
Copy link
Contributor

j08lue commented Sep 28, 2023

The issue is a bit mysterious and transient at this point. The app crashes sometimes when a new page is loaded, e.g. via click on another menu item.

Forcing reload fixes it, as we do in

But that degraded the user experience because the page reloads completely when switching between menu items.

Further investigation, e.g. via Sentry, is needed to get to the root of the issue

Acceptance criteria

  • Diagnosed and fixed the root cause of app crashes on page loads
@j08lue j08lue added the bug label Sep 28, 2023
@j08lue j08lue changed the title App crashes sometimes App sporadically crashes Sep 28, 2023
@hanbyul-here
Copy link
Collaborator

The cases that I've collected so far:

  • It happens when url is changed through react router.
  • It happens when a user stays on the same page for a while ( doing nothing), and the3n tries to navigate to the other pages.

@nerik
Copy link
Contributor

nerik commented Sep 28, 2023

Currently trying to work our way back to what could be causing the problem in the GHG instance as this wasn't happening in veda-config.
US-GHG-Center/veda-config-ghg#179

@hanbyul-here
Copy link
Collaborator

hanbyul-here commented Oct 4, 2023

I used the time after the demo to get to the root of this problem.

Crashes become noticeable after the introduction of Redirection

The problem seemed to be introduced after we put the logic for redirections using <Navigate /> component of React Router. Through React profiler, we could find that ShadowScrollbar was making way too many commits. (> 300 commits for scrolling on the page + clicking on the link on the nav.) We got rid of the redirection logic to resolve this issue. (The redirection logic was to prevent navigating to /explore page from the datasets that disable the dataset exploration/. which I can be a nice touch, but not really necessary.)

Screen Shot 2023-10-04 at 1 03 48 PM

Noting that I am not sure what part of redirection exactly triggered the unnecessary amount of ShadowScrollbar.

There seem to be still problems with ShadowScrollbar

However, redirection might have amplified the problem, but not be the root of the problem. For example, ShadowScrollbar makes way too many commits when it is active on the page still. (just opening sub nav - which uses ShadowScrollbar - makes more than 100 commits.)

screen-recording-shadow.mov

I will go ahead and edit or get rid of ShadowScrollbar to prevent further breaks.

hanbyul-here added a commit that referenced this issue Oct 5, 2023
Handles issue in
#682 (comment)


While putting this fix, I noticed that `use-media-query` returns
document body size, which differs from how CSS media query works. This
results in a weird style in between 991 px ~ 1000 px. (screenshot
attached, it is on ghg.center now) 👉 I didn't fix this problem, but I
patched it with CSS.

(Eventually, we would need to move to Container query instead of media
query:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries)

![Screen Shot 2023-10-04 at 3 01 10
PM](https://github.com/NASA-IMPACT/veda-ui/assets/4583806/215d0515-e4ff-4b42-b0b1-63a21506ad1c)
@j08lue j08lue closed this as completed Oct 30, 2023
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

No branches or pull requests

4 participants