Skip to content

Fix importing cancellation of one recurring instance - #1497

Open
sean0407 wants to merge 1 commit into
pimutils:masterfrom
sean0407:codex/khal-1466-cancel-single-instance-20261020
Open

sean0407 wants to merge 1 commit into
pimutils:masterfrom
sean0407:codex/khal-1466-cancel-single-instance-20261020

Conversation

@sean0407

Copy link
Copy Markdown

Summary

Merge a recurrence-specific METHOD:CANCEL into the existing event series instead of replacing the series with the single canceled instance. A cancellation for the same RECURRENCE-ID replaces the prior override.

Evidence

  • Before: tests/controller_test.py::TestImport::test_import_cancelled_single_recurrence failed after importing the cancellation: only the canceled Tuesday instance remained; Monday and Wednesday disappeared.
  • After: The regression passes, including reimporting the same cancellation. The three TestImport tests pass.
  • Full suite: 338 passed and 3 locale-display tests failed; those same 3 tests also fail on the clean base commit 3ba0fcef.
  • Changed files: khal/controllers.py, tests/controller_test.py, and CHANGELOG.rst.
  • git diff --check passed. Patch policy accepted 3 text files and 98 changed lines, with no binary files.

Merge Danger

Door: two-way

Blast Radius: localized

Only recurrence-specific cancellation imports with a duplicate UID take the merge path; other duplicate imports retain their existing update behavior.

@mschilli87

Copy link
Copy Markdown
Contributor

Not reviewing due to #1498 being submitted within half an hour to this. I don't think this project needs a lot of low-effort contributions. This is not about rejecting code generated using LLMs as a tool, but I need to trust the human behin the bot understands the changes they submit. Thus, I reserve my uncompensated work during my limited free time to contributions that other humans invested time and thought, not just money, in.

@sean0407

Copy link
Copy Markdown
Author

Thanks for explaining your concern. I understand that closing the other PR does not by itself address whether this contribution demonstrates enough understanding.

The behavior I traced here is specific to importing an iCalendar METHOD:CANCEL for one event in a recurring series: the duplicate-UID path previously replaced the stored series with the single cancelled instance. The change carries the calendar method into import_event, and only for a recurrence cancellation merges the matching RECURRENCE-ID exception into the existing calendar, replacing an earlier exception with the same recurrence ID. The regression test imports the same cancellation twice and checks that all three daily instances remain, with only the Tuesday instance marked cancelled.

I added this explanation so the reasoning behind the change is reviewable. I understand if you still prefer not to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants