Skip to content

fix: prevent concurrent goal reset race conditions#2112

Open
Kokila-chandrakar wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
Kokila-chandrakar:feat/activity-heatmap
Open

fix: prevent concurrent goal reset race conditions#2112
Kokila-chandrakar wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
Kokila-chandrakar:feat/activity-heatmap

Conversation

@Kokila-chandrakar
Copy link
Copy Markdown
Contributor

@Kokila-chandrakar Kokila-chandrakar commented Jun 6, 2026

Summary

Fixes a race condition that could occur when multiple goal reset requests are processed simultaneously, preventing inconsistent goal state updates.

Changes

  • Added optimistic locking for goal reset operations
  • Prevented concurrent reset requests from overwriting each other
  • Improved consistency and reliability of goal state updates
  • Updated goal reset handling logic in the API route

Testing

  • Verified normal goal reset flow works correctly
  • Tested concurrent reset requests
  • Confirmed no duplicate or conflicting goal state updates occur

Closes

Fixes #1145

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 6, 2026

@Kokila-chandrakar is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature labels Jun 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

The PR title says 'Activity Heatmap' but the diff only contains the goal reset race condition fix (goal_reset_version optimistic locking). The ActivityHeatmap component and punch-card API route mentioned in the description are not in the diff.

The goal reset fix itself is valid and needed — please open a separate PR for just that fix with the correct title (e.g. 'fix: prevent concurrent goal reset race conditions'). We'll merge it immediately.

@Kokila-chandrakar Kokila-chandrakar changed the title feat: add GitHub-style Activity Heatmap to dashboard fix: prevent concurrent goal reset race conditions Jun 6, 2026
@Kokila-chandrakar
Copy link
Copy Markdown
Contributor Author

Thanks for catching that. I've updated the PR title and description to match the actual changes in the diff. This PR only contains the goal reset race condition fix. Please review again when you get a chance.

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

Labels

gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add recent activity heatmap to user dashboard

2 participants