Repository navigation
fix: move open dates when the raid time changes - #16
Merged
Merged
Conversation
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.
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.
Problem
Changing a schedule's start and end time had no visible effect.
SaveScheduleonly 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):team.RaidTimes: the start/end calculation (overnight raids, DST gaps), pulled out ofGenerateOccurrencesso publishing and saving share it.Bot.RefreshOpenPolls: after a schedule or roster save, every open timetable is queued for a background Discord refresh. It replacesRefreshTeamPoll, 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:go vet,go test ./...withTEST_DATABASE_URL,npm run check,format:check,build, and Playwright (23 passed) all pass locally.