fix(sync): fallback to historyMap on API fetch failure (#263)#271
Open
yashvi-3106 wants to merge 1 commit into
Open
fix(sync): fallback to historyMap on API fetch failure (#263)#271yashvi-3106 wants to merge 1 commit into
yashvi-3106 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for submitting a pull request. Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully. Formatting and Branching
|
Contributor
Author
|
@jagdish-15 you can review it! |
jagdish-15
requested changes
Jul 1, 2026
jagdish-15
left a comment
Collaborator
There was a problem hiding this comment.
Looks like this branch contains a few commits from your previous PR.
Could you cherry-pick just the commit related to this issue and then force-push the branch again? That'll keep this PR focused and make it easier to review.
c5ce622 to
83ea143
Compare
Contributor
Author
|
@jagdish-15 you can review it now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves issue #263 where active users were being dropped entirely from the leaderboard when external API wrapper fetches failed (due to rate limiting, network timeouts, or DNS failures).
Linked Issue
Fixes #263
Changes Made
scripts/sync-leaderboard.jsto look up the user's cached records fromhistoryMapwhenfetchDatafails instead of logging and returning prematurely.easySolved,mediumSolved,hardSolved,score, etc.) if available.Type of Change
Testing
Note: Tested using a mock environment by simulating API timeouts/rate-limit failures for test users and verifying that the daily sync recycled their previous overall data and scores correctly without dropping them.
Checklist
npx prettier --write .before submittingfeature/*branch, not themainbranch