Skip to content

fix: move open dates when the raid time changes - #16

Merged
joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi
Oct 6, 2026
Merged

joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi

Conversation

@joshchen-dev

@joshchen-dev joshchen-dev commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Problem

Changing a schedule's start and end time had no visible effect. SaveSchedule only rewrote the template for future periods, so the open period kept its old times in the availability grid and in the Discord post.

Fix

  • SaveSchedule(ctx, draft, now):
    • in the same transaction, every date in the team's open periods that hasn't started yet moves to the new start/end time on the same local day
    • the local day is read in the previous timezone and the new time applied in the new one, so a timezone change moves dates too
    • votes and status are kept
    • an invalid time on a DST change is a validation error (400)
  • Weekday changes still start with the next period, because removing a date from an open period would discard its votes. The schedule page now explains this whenever a schedule already exists.
  • team.RaidTimes: the start/end calculation (overnight raids, DST gaps), pulled out of GenerateOccurrences so publishing and saving share it.
  • Bot.RefreshOpenPolls: after a schedule or roster save, every open timetable is queued for a background Discord refresh. It replaces RefreshTeamPoll, which edited only the latest poll and synchronously.

Release v0.0.15.

Tests

  • TestSavingScheduleMovesUpcomingDatesInOpenPeriods: with Monday's raid already started, saving 20:00–22:30 and dropping Monday:
    • leaves Monday unchanged
    • moves Wednesday to 20:00–22:30 on the same date
    • keeps Wednesday's vote
    • keeps both dates in the open period
  • I checked that the test fails when the move is disabled.
  • Playwright: the schedule page shows the explanation.
  • go vet, go test ./... with TEST_DATABASE_URL, npm run check, format:check, build, and Playwright (23 passed) all pass locally.

Saving the schedule only changed the template for future periods, so the
open period kept showing the old raid time on the web and in Discord.

Saving a new start/end time or timezone now also moves every date that
hasn't started in the team's open periods to the new time on the same
local day, keeping its votes and status. Weekday changes still start with
the next period, because removing a date would discard its votes; the
schedule page now says so. After a schedule or roster save, every open
timetable is re-rendered in Discord, not just the latest one.

Release v0.0.15.
@joshchen-dev
joshchen-dev merged commit 24229e0 into main Oct 6, 2026
1 check passed
@joshchen-dev
joshchen-dev deleted the claude/great-shannon-b4y5vi branch October 6, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant