Skip to content

Sync: dev to main - #612

Merged
aamoghS merged 3 commits into
mainfrom
dev
Nov 14, 2026
Merged

aamoghS merged 3 commits into
mainfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from dev into main.


Note

Medium Risk
Touches concurrency-sensitive capacity checks for events, hackathon seats, and team rosters; behavior should be more correct but any locking/counting bugs could admit or refuse people incorrectly.

Overview
Replaces stored counters (events.current_check_ins, hackathon_teams.current_members, hackathons.current_participants) with live counts from child rows, fixing drift when cascades or deletes did not update the columns (columns stay in the DB for now but are no longer read or written).

A new derived-counts service batches grouped count(*) queries and merge helpers. Event check-in capacity locks the event row and counts event_check_in rows instead of incrementing a counter; hackathon acceptance drops syncCurrentParticipants and relies on assertSeats plus derived reads; team join/leave counts participants under a team lock and stops updating current_members. List/detail paths (events, hackathons, teams, bootcamp admin, public /events) return the derived numbers.

CI sets TEST_DATABASE_URL and adds derived-counts.db.test.ts against real Postgres; mocks and docs are updated to match.

Reviewed by Cursor Bugbot for commit 647dff0. Bugbot is set up for automated code reviews on this repo. Configure here.

aamoghS and others added 3 commits November 14, 2026 16:25
Each was a single-column index on the leading column of a unique index or
constraint on the same table, which already serves those lookups. They only
added a write per insert and update.
event.current_check_ins, hackathon_team.current_members and
hackathon.current_participants were running counters. FK cascades (deleting
a user, deleting a team) removed the rows they counted without touching
them, so they drifted and the capacity checks that read them could refuse
real people. Capacity checks now count the child rows under the same
parent-row lock, and every read derives the number with one grouped query
per list. joinTeam now takes that lock too.

The columns stay, unread and unwritten, until a later change drops them.
A real-database test (gated on TEST_DATABASE_URL, set in CI) sets the
stored counters wrong on purpose and checks every count follows the rows.
@github-actions

Copy link
Copy Markdown
Contributor Author

@greptileai

@aamoghS aamoghS closed this Nov 14, 2026
@aamoghS aamoghS reopened this Nov 14, 2026
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor Author

Visit the preview URL for this PR (updated for commit 647dff0):

https://hacklytics2027--pr-612-hjbcnvxj.web.app

(expires Sat, 21 Nov 2026 22:22:39 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@github-actions

Copy link
Copy Markdown
Contributor Author

Visit the preview URL for this PR (updated for commit 647dff0):

https://hacklyticss2026--pr-612-lfib7418.web.app

(expires Sat, 21 Nov 2026 22:22:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5d238be33273095766c18a8339b7b0c47de8a950

@aamoghS
aamoghS merged commit 3994ee1 into main Nov 14, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant