-
Notifications
You must be signed in to change notification settings - Fork 164
fix: fixed rerun operation when the course is too large #2581
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for the pull request, @Asespinel! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2581 +/- ##
==========================================
+ Coverage 94.74% 94.77% +0.02%
==========================================
Files 1218 1225 +7
Lines 27299 27432 +133
Branches 5983 6184 +201
==========================================
+ Hits 25865 25998 +133
+ Misses 1376 1363 -13
- Partials 58 71 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for this contribution. Let me know when it's ready for review. I see you implemented custom retry logic; in the long term, we'd like to migrate all data loading to React Query, which provides retry logic already. Did/could you consider updating this to use React Query, so we can use its retry logic? Does this code to retry with backoff only when the course is new/rerun / seems to exist but has no outline yet, or does it always retry the outline no matter what? Also, did you use any AI tools when creating this code? If so, please mention that in the PR description. |
Description
This PR implements retry logic with exponential backoff to handle course re-run operations for large courses. When a course is re-run, the backend needs time to process and create the new course structure, which can result in temporary 404 or 202 responses. This change ensures the frontend waits appropriately instead of immediately showing "Not Found" errors.
Problem
When performing a re-run operation on large courses, the following issues occurred:
fetchCourseDetailwould succeed butfetchCourseOutlineIndexwould fail, leading to undefined properties (e.g.,isEnabled)Solution
Implemented a
retryOnNotReadyhelper function with exponential backoff that:course_does_not_existerrors during the initial attemptsTechnical Details
Retry Logic
Parameters:
maxRetries: Maximum number of retry attempts (default: 10)initialDelay: Initial delay in milliseconds (default: 2000ms)backoffMultiplier: Multiplier for exponential backoff (default: 1.5)Retry Conditions:
course_does_not_existerror during first 5 attemptsWhy Exponential Backoff?
Large courses can take 30-60 seconds to process. Exponential backoff:
Testing
Manual Testing Steps