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 occasional perma loading on explore page #627

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

39bytes
Copy link
Collaborator

@39bytes 39bytes commented Jan 10, 2025

On the explore page, if you click on a course and press back + scroll down quickly, occasionally it will get permanently stuck in a loading state. (I can reproduce this quite easily on prod)

I think this happens because there's a race condition between two network requests, one for fetching page 1 and the other for fetching page 2, which somehow leads to courses being set to undefined after they resolve?
I tried to fix this by just falling back to the batch's courses instead of using the null chaining operator.
As far as I can tell from local testing with network throttling, it's fixed

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.21%. Comparing base (811f72c) to head (5a0a98c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #627   +/-   ##
=======================================
  Coverage   86.21%   86.21%           
=======================================
  Files          45       45           
  Lines        6425     6425           
=======================================
  Hits         5539     5539           
  Misses        886      886           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant