fix: iCal DTEND rolls to the next day for midnight-straddling sets#626
Merged
Conversation
A set crossing midnight (23:30-00:30) stamped DTEND with the same calendar date as DTSTART, producing an invalid VEVENT (end before start) that calendar clients may reject. When end_time < start_time (zero-padded HH:MM compares lexicographically), DTEND now stamps the following day — mirroring prepareBands()'s endMs < startMs roll. Pure after-midnight sets (00:00-05:59 starts) are unaffected. Closes #601 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
generateICal()stamped DTSTART and DTEND with the same calendar date, so a set straddling midnight (e.g. 23:30–00:30) emitted DTEND before DTSTART — an invalid VEVENT that calendar clients may reject or render with garbage duration (#601, found during #600 review). Whenend_time < start_time(zero-padded HH:MM compares lexicographically), DTEND now stamps the next calendar day via a DST-proof UTC date helper — the exact mirror ofprepareBands()'sendMs < startMsroll on the frontend. Pure after-midnight sets (starts 00:00–05:59) are untouched: both stamps correctly share the stored date, and the existing test pinning that behaviour still passes.Closes #601
What changed
functions/api/feeds/ical.jsendDaterolls +1 day whenendTime < startTime(rationale + after-midnight distinction commented);nextCalendarDay()helper (UTC math on the date literal)functions/api/feeds/__tests__/ical.test.jsSecurity / correctness notes
None — public read-only feed; only the DTEND date component changes, and only for straddling sets.
Verification
validate:openapi: n/a — feed route, response shape unchangedBuilt by Theo · Reviewed by Theo · 🤖 Claude Code