Skip to content

fix: explicitly query questionFrontendId (fixes #65) - #85

Open
aadesh006 wants to merge 2 commits into
joshcai:masterfrom
aadesh006:master
Open

fix: explicitly query questionFrontendId (fixes #65)#85
aadesh006 wants to merge 2 commits into
joshcai:masterfrom
aadesh006:master

Conversation

@aadesh006

Copy link
Copy Markdown

Fixes #65

The Issue

Recent changes to LeetCode's GraphQL submissions endpoint caused it to omit the questionFrontendId in the submission details payload. Because of this, the sync script falls back to the internal backend ID (which are often >4000), resulting in incorrectly numbered directory names (e.g., 4369-even-number-of-knight-moves instead of the correct frontend ID).

The Fix

  1. Updated the getQuestionDetail GraphQL query in getQuestionData to explicitly request questionFrontendId.
  2. Modified the return payload to pass the entire question object instead of just the content string.
  3. Updated the commit path generation logic to strictly check for and apply questionData.questionFrontendId with padStart(4, '0') before falling back to submission.qid.
  4. Recompiled dist/index.js to ensure the artifact reflects the patch.

Tested locally and successfully generates the correct 0001-padded frontend ID directory structure.

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.

wrong problem number

1 participant