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

fix: Gracefully fail when getUserData fetch returns HTTP 503 #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlazaric
Copy link

I have noticed the same issue described in #102 where the extension is sometimes stuck in the loading wheel phase. After some playing around, it looks like the problem happens when the getUserData fetch returns HTTP response status code 503 which sometimes happens with HackerNews if you refresh quickly or open a lot of links at once. The fetched page looks like this:

image

Because of the 503 page, the resulting topBarElements is empty and actualTopBar is set to undefined which leads to an Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'children') on line 90 of the utils.js file.

Steps to reproduce

  1. Put a breakpoint on line 3080 in file refined-hacker-news.js.
  2. Refresh https://news.ycombinator.com/news a couple of times quickly.
  3. At some point actualTopBar will become undefined.

@plibither8 plibither8 changed the base branch from master to main September 25, 2022 17:11
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.

None yet

1 participant