Skip to content

Issue: Missing Directory Creation Check for Daily Snapshots #406

Open

Description

@Yashaswini-K-P

File Name

scripts/sync-leaderboard.js

Problem

While the script explicitly creates the user-data directory using fsPromises.mkdir({ recursive: true }) before writing files, it does not ensure that the daily directory (DATA_DIR/daily) exists. If the daily folder is missing (e.g., in a fresh repository clone or after a clean-up step), writing the daily snapshot via atomicWrite will crash with an ENOENT error.

Proposed Solution

Explicitly create the daily output directory recursively prior to writing daily JSON files, similar to how user-data is handled.

Implementation Details

  • Directory Initialization: Add a directory creation check before writing daily data:
    await fsPromises.mkdir(path.join(DATA_DIR, "daily"), { recursive: true });

Activity

  1. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    Thank you for opening an issue.

    Please review our CONTRIBUTING.md guidelines before getting started.

    A maintainer will review this issue shortly. If you would like to work on the issue yourself, please leave a comment requesting assignment.

    Issue Assignment Policy

    • The issue creator is given the first priority to work on their issue.
    • If the creator declines or does not request assignment, the issue will be assigned to others in the order of requests received.
    • Please do not submit PRs or begin work until you are officially assigned.

    Note: This project is currently maintained by a solo maintainer, so reviews, assignments, and responses may sometimes take a little time. Thanks for your patience.

  2. aaniya22 commented on Aug 6, 2026

    @aaniya22
    Contributor

    pls assign this to me under gssoc

  3. added
    type:bug
    level:beginner
    Backend
    on Aug 8, 2026
  4. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    This issue has been inactive for 14 days and has been marked as stale. To keep this issue open, please leave a comment.

  5. Yashaswini-K-P commented on Aug 29, 2026

    @Yashaswini-K-P
    ContributorAuthor

    working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Backendlevel:beginnertype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions