Skip to content

fix(sync): stats unavailable hotfix (v3.5.1) - #26

Merged
night-slayer18 merged 3 commits into
mainfrom
dev
Aug 27, 2026
Merged

fix(sync): stats unavailable hotfix (v3.5.1)#26
night-slayer18 merged 3 commits into
mainfrom
dev

Conversation

@night-slayer18

Copy link
Copy Markdown
Owner

Summary

Fixes the leetcode sync command always showing Stats unavailable in commit bodies.

Root Causes

Two independent bugs, both confirmed via live API probe:

  1. Missing credential loadingsyncCommand() called getSubmissionList() before loading stored session credentials onto the HTTP client. Git auth (SSH/PAT) is independent of the LeetCode session, so the command could push to GitHub while unauthenticated against the LeetCode API.

  2. Schema type mismatchSubmissionDetailsSchema declared runtime and memory as string, but the API returns them as number (raw ms / bytes). Zod rejected every response, triggering the catch block for every user on every problem.

Changes

  • src/commands/sync.ts — call setupClientIfLoggedIn() at entry
  • src/schemas/api.tsruntime/memory accept number | string, lang nullable
  • src/types.tsSubmissionDetails interface updated to match
  • src/commands/submissions.ts — null guard for details.lang
  • src/__tests__/commands/sync.test.ts — 5 new regression tests (20 total)
  • release.mjs — new release prep script
  • docs/releases.md — v3.5.1 changelog entry
  • package.json / src/index.ts — version bumped to 3.5.1

Testing

All 350 tests pass. Verified live against LeetCode API with authenticated session.

…s schema types

Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
…vailable

Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, @night-slayer18! 🎉

Before this gets reviewed, please make sure the following are checked:

  • Tests pass locally (npm test)
  • Type check passes (npm run typecheck)
  • Lint passes (npm run lint)
  • New features include tests
  • Documentation updated if needed
  • PR targets the dev branch (not main)

See CONTRIBUTING.md for full guidelines.

The CI pipeline will also run build, test, lint, and typecheck automatically.

@github-actions github-actions Bot added the bug Something isn't working label Aug 27, 2026
@night-slayer18
night-slayer18 merged commit a731cd1 into main Aug 27, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant