Skip to content

[scheduler-premium] Key recurring exDates on their data-timezone day - #23467

Merged
rita-codes merged 12 commits into
mui:masterfrom
rita-codes:scheduler-exdate-data-timezone-key
Sep 1, 2026
Merged

rita-codes merged 12 commits into
mui:masterfrom
rita-codes:scheduler-exdate-data-timezone-key

Conversation

@rita-codes

@rita-codes rita-codes commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Deleting "only this event" of a recurring series could silently not stick: the occurrence re-appeared on the next render. It happened for events using instant strings (...Z) with an explicit timezone, whenever the machine's zone differed from the event's.

Why: occurrences are matched to their exDates by day, and "what day is this instant?" depends on the timezone you ask in. resolveEventDate returned ...Z dates labeled in the machine's zone, while occurrences are keyed by their day in the event's timezone — same instant, different day, so the exclusion never matched. The timezone docs already promise that recurrence math runs in the event's timezone.

Fix: label the parsed date in the event's timezone inside resolveEventDate — the single string→date conversion point (#21286) — so every consumer is correct at once. This also fixes two more bugs of the same class found during review: an object-API rrule.until ending the series one day early, and the display BYDAY projecting the wrong weekday. On top of that:

  • updateRecurringEvent / deleteRecurringEvent normalize occurrenceStart into the data timezone once at the dispatch, covering all five scope paths (defense for direct callers; the store already did this on its side).
  • The occurrence expander's manual DTSTART relabel is removed — now redundant.

The instant never changes (setTimezone keeps the timestamp, serialization is untouched) — only which calendar the date answers day/weekday questions with.

Tests (all red/green): labeling pins in processEvent, exDate exclusion at a fixed offset and across the Nov 2025 DST fall-back, the UNTIL last day, the BYDAY projection, mislabeled-input pins on both dispatchers, and a store-level round trip (delete → serialize → reprocess → still excluded).

Known pre-existing follow-up (untouched here): the RRULE string branch parses UNTIL=...Z as wall time, now asymmetric with the object branch.

Found while reviewing #23462; no file overlap.

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23467--material-ui-x.netlify.app/
QR code for https://deploy-preview-23467--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 🔺+17B(0.00%) 🔺+4B(0.00%)
@mui/x-scheduler-premium ▼-76B(-0.01%) ▼-1B(0.00%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@rita-codes rita-codes self-assigned this Aug 31, 2026
@rita-codes rita-codes added type: bug It doesn't behave as expected. scope: scheduler Changes related to the scheduler. labels Aug 31, 2026
rita-codes and others added 6 commits August 31, 2026 18:56
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC6LfHbZXD549R8qtmQojJ
…unction preconditions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC6LfHbZXD549R8qtmQojJ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC6LfHbZXD549R8qtmQojJ
@rita-codes rita-codes added the plan: Premium Impact at least one Premium user. label Sep 1, 2026
@rita-codes rita-codes changed the title [scheduler] Key recurring exDates on their data-timezone day [scheduler-premium] Key recurring exDates on their data-timezone day Sep 1, 2026

@noraleonte noraleonte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👌💙

Claude liked your PR btw 😆

Image

rita-codes and others added 3 commits September 1, 2026 12:57
Per review: the dispatcher normalized occurrenceStart but not
changes.start/end, so a direct caller passing both in the same zone
would compare mixed labels in applyRecurringUpdateAll. Drop the
dispatcher normalization instead and document the expected labels.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MidtChf5bPyveMGRfZdiMy
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MidtChf5bPyveMGRfZdiMy
@rita-codes
rita-codes merged commit 3134f87 into mui:master Sep 1, 2026
22 checks passed
rita-codes added a commit to rita-codes/mui-x that referenced this pull request Sep 1, 2026
`toOccurrence` now resolves the occurrence start labeled in the data timezone
(mui#23467), and a labeled date stringifies with an offset suffix that
`resolveEventDate` re-reads as wall time — shifting cross-timezone occurrence
fixtures by the UTC offset. Serialize the round-tripped model as UTC instants.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CC6LfHbZXD549R8qtmQojJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan: Premium Impact at least one Premium user. scope: scheduler Changes related to the scheduler. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants