ekctl icon indicating copy to clipboard operation
ekctl copied to clipboard

update/delete event on a recurring event changes the first occurrence, not the one the id was listed for

Open pkarpovich opened this issue 2 months ago • 0 comments

list events returns every occurrence of a recurring event with the same id, but show event, update event and delete event resolve that id with eventStore.event(withIdentifier:), which returns the first occurrence of the series, and then save or remove it with span: .thisEvent. There is no way to address any other occurrence, and the result is silently wrong.

Repro on v1.8.0 (macOS 27, iCloud calendar):

ekctl add event --calendar <id> --title "test" --start 2026-10-06T21:00:00+02:00 --end 2026-10-06T21:15:00+02:00 --recurrence-frequency weekly --recurrence-end-count 4
ekctl list events --calendar <id> --from 2026-10-01 --to 2026-11-01   # 4 occurrences, one id
  1. Take the id from the Oct 20 entry of list events and run update event <id> --title "renamed": the Oct 6 occurrence is renamed and detached, Oct 20 is unchanged.
  2. update event <id> --start 2026-10-20T22:00:00+02:00 --end 2026-10-20T22:15:00+02:00 moves that detached Oct 6 occurrence to Oct 20 22:00. Oct 20 now has two events, Oct 6 is gone, and the rename from step 1 is lost.
  3. On a fresh series of three occurrences, take the id from the last entry and run delete event <id>: the first occurrence is removed and the last one stays.

All three report success.

The repro series starts in the future, so its first occurrence happens to be the next one. For a series that started in the past, the first occurrence is in the past too: on a weekly series that began in June 2024, show event with the id from this week's entry returns the June 2024 occurrence. update event or delete event there would change an occurrence from two years ago and leave this week's untouched.

Proposal: an --occurrence <start> option on show event, update event and delete event. It finds the occurrence with events(matching:) over that day, keeps the one with the same eventIdentifier and that start date, and saves or removes it with .thisEvent. Without the option nothing changes.

Would you take a PR for this? Happy to adjust the flag name or the matching rule.

pkarpovich avatar Oct 05 '26 11:10 pkarpovich