Skip to content

Bootcamp gate uses the session's term; analytics "today" in Eastern time - #428

Merged
aamoghS merged 2 commits into
devfrom
fix/term-and-timezone
Sep 25, 2026
Merged

aamoghS merged 2 commits into
devfrom
fix/term-and-timezone

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from fix/term-and-timezone into dev.


Note

Medium Risk
Changes admission rules for bootcamp-only events and how daily check-in metrics are bounded; both affect live event operations but are narrowly scoped with new tests.

Overview
Bootcamp QR check-in now compares a member’s bootcampTerm to the session’s stored term (event.bootcampTerm, falling back to currentTerm()), not the calendar “current” term at scan time. That keeps past/future-term sessions gated correctly when the semester rolls over.

Admin analytics checkinsToday counts scans since Eastern (Atlanta) midnight via new exported startOfEasternDay, fixing UTC server rollover that treated “today” as flipping around 8pm Eastern.

Tests cover startOfEasternDay (including DST edge cases) and bootcamp admit/deny by session term.

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

- events.checkIn compared a member's bootcampTerm with currentTerm(),
  the wall clock, rather than the session's own bootcampTerm (which
  upsertSession stamps). The session's term now decides, falling back to
  the current term for events with none.
- analyticsOverview's "check-ins today" started at server-local
  midnight. App Hosting runs in UTC, so the tile reset at 8pm Eastern,
  in the middle of evening events. It now starts at midnight
  America/New_York.
@github-actions
github-actions Bot requested a review from aamoghS as a code owner September 25, 2026 03:15
@aamoghS aamoghS changed the title Feature: fix/term-and-timezone to dev Bootcamp gate uses the session's term; analytics "today" in Eastern time Sep 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit edf380d. Configure here.

Comment thread packages/api/src/routers/admin.ts Outdated
eastern.getMinutes() * 60_000 +
eastern.getSeconds() * 1000 +
now.getMilliseconds()),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DST skews Atlanta midnight window

Low Severity

startOfToday subtracts the Eastern clock time from now, which only equals Atlanta midnight on a 24-hour day. After the spring-forward or fall-back transition, that window starts an hour early or late, so checkinsToday counts the wrong hour of scans for the rest of those Sundays.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit edf380d. Configure here.

Review follow-up. Subtracting the Eastern clock time from now only lands
on midnight on a 24-hour day; on the spring-forward and fall-back
Sundays the check-ins-today window started an hour off.
startOfEasternDay now takes today's Eastern date and keeps whichever of
the two Eastern offsets reads 00:00 there (the switch is at 2am, so
midnight always exists exactly once). Tested on both DST days.
@github-actions github-actions Bot added the bug Something isn't working label Sep 25, 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

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

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

https://hacklytics2027--pr-428-xtd47l7u.web.app

(expires Fri, 02 Oct 2026 13:28:23 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@aamoghS
aamoghS merged commit 2647ec1 into dev Sep 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant