Skip to content

fix: Timezone-Agnostic Daily Streak Calculation (#191)#198

Open
nitishchaubeyy wants to merge 9 commits into
indresh404:mainfrom
nitishchaubeyy:fix/timezone-agnostic-streaks
Open

fix: Timezone-Agnostic Daily Streak Calculation (#191)#198
nitishchaubeyy wants to merge 9 commits into
indresh404:mainfrom
nitishchaubeyy:fix/timezone-agnostic-streaks

Conversation

@nitishchaubeyy
Copy link
Copy Markdown
Contributor

Description

Resolves #191 by anchoring the Daily Activity Streak evaluation logic exclusively to standardized UTC dates, preventing local system timezones from corrupting streak continuations or permitting double-dipping.

Key Changes:

  • String-Based Boundaries: Shifted date comparison logic from raw new Date() milliseconds to explicit YYYY-MM-DD ISO strings representing the strict UTC boundary.
  • Math Refactoring: Replaced sequential timestamp math with discrete Date.UTC() calculations to accurately check if the time difference is exactly 1 day (diffDays === 1).
  • Points Synchronization: Streak increments now safely increment streakPoints and totalPoints using proper database mutation standards during the login handshake.
  • Restored Batch Integrity: Maintained the previously integrated writeBatch infrastructure inside syncGitHubData (Issue [Feature][Level 3] Atomic Batch Writes for Profile Sync to Prevent Data Fragmentation #193) to ensure full file compatibility.

Fixes #191

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ranker-hub Ready Ready Preview, Comment Jun 4, 2026 10:53am

@github-actions github-actions Bot added backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review labels Jun 3, 2026
@indresh404
Copy link
Copy Markdown
Owner

merge conflict

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Done @indresh404

@indresh404
Copy link
Copy Markdown
Owner

Solve Merge Conflict

1 similar comment
@indresh404
Copy link
Copy Markdown
Owner

Solve Merge Conflict

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Done @indresh404

@indresh404
Copy link
Copy Markdown
Owner

CI Checks / Lint Check test should pass

@nitishchaubeyy
Copy link
Copy Markdown
Contributor Author

Completed @indresh404

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

Labels

backend Backend/Firebase related changes bug Something isn't working enhancement New feature or request gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 level:advanced level3 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Level 3] Timezone-Agnostic Daily Streak Calculation

2 participants