fix: 1318 - cancellation within 24 hours + show prior rsvp status - #1323
Open
leahpeker wants to merge 7 commits into
Open
fix: 1318 - cancellation within 24 hours + show prior rsvp status#1323leahpeker wants to merge 7 commits into
leahpeker wants to merge 7 commits into
Conversation
This was referenced Aug 8, 2026
leahpeker
added a commit
that referenced
this pull request
Aug 8, 2026
… (Issue 1318) test_event_stats.py mixed helper unit tests (_cancellations, _resolve_cancelled_at, rsvp counts) with API endpoint tests (TestStatsEndpoint, TestSetAttendance). Split the API endpoint classes into test_event_attendance_api.py, which imports the shared fixtures + _auth helper from test_event_stats. No behavior change — pure move, done ahead of PR #1323 (which would otherwise push this file over the 500-line hard cap).
leahpeker
force-pushed
the
fix-1318-cancellation-window-rsvp-history
branch
2 times, most recently
from
August 8, 2026 14:33
f5a4e97 to
d82f2d1
Compare
2 tasks
leahpeker
force-pushed
the
fix-1318-cancellation-window-rsvp-history
branch
from
August 9, 2026 04:56
066d04a to
9268fa4
Compare
…y (Issue 1318) - Add previous_status field to EventRSVP to track status before cancellation - Fix within_24_hours calculation: now uses timedelta instead of .days==0 (handles same-day edge) - Wire _resolve_previous_status through upsert + host RSVP write paths - Clear previous_status when poll finalize resets to ATTENDING - Add API schema fields for within_24_hours + previous_status - Frontend: use within24Hours instead of .days===0, render "(was going)" / "(was maybe)" labels - Tests: 24h boundary cases, previous_status stamping via both endpoints, label rendering
… 1318) Replaces the within_24_hours elapsed-timedelta check with a same_day field comparing calendar dates in local time. The app is NY-based, so settings.TIME_ZONE moves from UTC to America/New_York — this also fixes timezone.localtime() call sites (invite emails, RSVP views) and the attendance-reminder cron's day-boundary math to use local days.
…sue 1318) _attendance_clock.py and send_attendance_reminders.py truncated aware UTC datetimes to .date() without converting to local time first. Now that TIME_ZONE is America/New_York, midnight-UTC timestamps landed on the wrong calendar day. Use timezone.localtime() before truncation. Also fixes test_attendance_clock.py fixtures that built midnight-UTC datetimes, which flip to the previous day once localtime() is applied.
…(Issue 1318) TIME_ZONE was flipped from UTC to America/New_York app-wide, but nothing in the app calls timezone.activate() — so that global setting was the sole driver for every bare timezone.localtime() call across the whole backend (~70+ call sites), not just the 3 that needed local-day semantics for this fix. Revert TIME_ZONE to UTC and pass a new settings.LOCAL_DAY_TZ explicitly at the 3 call sites that actually need "local calendar day" comparisons (_cancellations same_day, _attendance_clock anchor/last-attendance dates, attendance-reminder "today"). Same fix, no app-wide blast radius.
…ys_before_event (Issue 1318) same_day and days_before_event were two separate computations that could disagree: days_before_event was a raw UTC duration truncated to whole days, while same_day compared local calendar dates. A cancellation minutes after a near-midnight event start could yield same_day=True and days_before_event=-1 simultaneously, and the frontend's day<0 check ran before the sameDay check, silently dropping the same-day label. Redefine days_before_event itself as the difference between local calendar dates (start_date - cancelled_date), so it's timezone-correct and same_day becomes redundant. Removes the field from the API schema, model mapping, and frontend — one source of truth instead of two.
leahpeker
force-pushed
the
fix-1318-cancellation-window-rsvp-history
branch
from
August 9, 2026 14:01
c0d86a7 to
993f419
Compare
leahpeker
marked this pull request as ready for review
August 9, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(start - cancelled_at).days == 0). A cancellation the day before could truncate to 0 days. Now compares an actualtimedeltaagainst 24 hours, both backend (_cancellations()) and frontend, and the label reads "cancelled within 24 hours".EventRSVP.previous_statusto track what a guest's RSVP was immediately before they cancelled, so hosts can distinguish "was going" vs. "was maybe" cancellations. Stamped on every write path that transitions an RSVP to cancelled (self-serve and host-driven), plus cleared alongsidecancelled_atin the poll-finalize path for consistency. Surfaced in the cancellations list UI.Test plan
make agent-typecheck— cleanmake agent-lint— cleanmake agent-frontend-typecheck— cleanmake agent-frontend-lint— cleanmake agent-frontend-test— 142/142 files, 1168 passed, 1 skippedtest_event_stats.py,test_host_rsvp.py,test_rsvp.py) — 90/90 passedpg_notify+ RSVP-capacity race test, need real Postgres row locking)