Skip to content

[scheduler] Keep the occurrence date when editing only one recurring event#23007

Merged
rita-codes merged 6 commits into
mui:masterfrom
Anexus5919:fix/scheduler-only-this-occurrence-start
Jun 30, 2026
Merged

[scheduler] Keep the occurrence date when editing only one recurring event#23007
rita-codes merged 6 commits into
mui:masterfrom
Anexus5919:fix/scheduler-only-this-occurrence-start

Conversation

@Anexus5919

Copy link
Copy Markdown
Contributor

Fixes a bug where editing a single recurring occurrence (scope "only this") without changing its date dropped the detached event onto the series DTSTART.

applyRecurringUpdateOnlyThis only set the detached event's start/end when the caller provided changes.start/changes.end. extractStandaloneEvent builds the detached event from the series model, whose start/end are the DTSTART/DTEND, so when changes omitted them the detached event kept the DTSTART. The EXDATE for the edited day was still added, so the edited occurrence disappeared and a duplicate appeared on the first day of the series.

The fix defaults start/end to the edited occurrence (and the computed occurrence end) when changes omit them, matching the existing applyRecurringUpdateFollowing. The built-in event dialog always submits start/end, so it was not affected; the public store.updateRecurringEvent API with partial changes hit the bug.

Closes #22962

Changelog

Editing a single recurring occurrence ("only this") without changing its date no longer moves the event onto the series start date.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Anexus5919

Copy link
Copy Markdown
Contributor Author

@rita-codes @michelengelen Kindly have a review on this pr. Thanks!

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23007--material-ui-x.netlify.app/
QR code for https://deploy-preview-23007--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 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 🔺+22B(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 added type: bug It doesn't behave as expected. scope: scheduler Changes related to the scheduler. labels Jun 29, 2026
@rita-codes

rita-codes commented Jun 29, 2026

Copy link
Copy Markdown
Member

Nice catch!

The fix looks correct — it mirrors applyRecurringUpdateFollowing's defaulting (changes.start ?? occurrenceStart / changes.end ?? occurrenceEnd), getOccurrenceEnd is already imported, and the test covers the partial-changes path the built-in dialog never exercises.

One related thing worth folding in: the changes doc on UpdateRecurringEventParameters (SchedulerStore.types.ts) still says start and end "are required", which is no longer true now that only-this accepts partial changes. Worth updating it to say they're optional and default to the edited occurrence, so the doc matches the behavior.

@Anexus5919

Copy link
Copy Markdown
Contributor Author

@rita-codes
Good call, thanks! Updated the UpdateRecurringEventParameters.changes doc to say start and end are optional and that the edited occurrence's date and time are kept when they're omitted (phrased to hold for all three scopes, since "all" keeps the existing date rather than defaulting to the occurrence).

@rita-codes

Copy link
Copy Markdown
Member

Thanks for the docs update! Two small things:

  • I'd just delete the line rather than reword it — start?/end? on the type already conveys they're optional, so the field comment can stay as plain The changes to apply.
  • You'll need to run pnpm prettier to fix one small formatting thing.

After that it's good to merge!

@Anexus5919

Copy link
Copy Markdown
Contributor Author

Done, thanks! Deleted the line so it's back to plain The changes to apply., and ran prettier (it wrapped a long dateToEventString call). 👍

@rita-codes rita-codes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing this!! 👏

@rita-codes
rita-codes merged commit 0d645d3 into mui:master Jun 30, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[scheduler] "Edit only this occurrence" without a date change drops the event onto the series DTSTART

2 participants