Keep each occurrence of a series sent without its master #36

Merged
jcoffey-dev merged 1 commits from fix/occurrences-without-master into main 2026-10-30 15:24:09 +00:00
Owner

Roadmap item 11, last part: when someone is invited to single occurrences of a series, with no master event, every occurrence is kept.

Import (import caldav)

  • An iCalendar resource can hold only RECURRENCE-ID occurrences of one UID. The import used to store the first and drop the rest; now each occurrence is its own row.
  • sync_id_dav names the first row. The others are found by calendar and UID, among rows no other server item names. CalDAV requires a UID to be unique within a calendar.
  • When the resource changes, rows are reused, added or dropped to match. When it vanishes, all of its rows go.
  • A master with overrides is unchanged: it stays one row.

Export

  • JMAP export matched events by UID alone, so several such occurrences, from any source including import jmap, all landed on one target event. It now matches by UID plus recurrenceId.
  • export-caldav writes every row that shares a UID in a calendar as one resource, and counts them per row. Before, the second row's If-None-Match: * PUT was refused.
  • export-files already wrote each occurrence; the new test now checks that.

Tests

  • tests/mock_dav_occurrences.rs runs in CI on the in-memory DAV server: import, a re-run, an occurrence added, one withdrawn, export into an empty server, a second export (all skipped), export-files, re-import of the exported copy (same rows), and deletion of the resource. It fails on old main (Week 2 dropped) and passes here.
  • A unit test covers the JMAP match key. There's no mock JMAP export test of the full plan.
  • Live runs: integration_radicale, integration_baikal and integration_export_dav all pass.

Checks: fmt, clippy -D warnings, cargo test --locked (1482 passed).

Roadmap item 11, last part: when someone is invited to single occurrences of a series, with no master event, every occurrence is kept. **Import (`import caldav`)** - An iCalendar resource can hold only `RECURRENCE-ID` occurrences of one UID. The import used to store the first and drop the rest; now each occurrence is its own row. - `sync_id_dav` names the first row. The others are found by calendar and UID, among rows no other server item names. CalDAV requires a UID to be unique within a calendar. - When the resource changes, rows are reused, added or dropped to match. When it vanishes, all of its rows go. - A master with overrides is unchanged: it stays one row. **Export** - JMAP `export` matched events by UID alone, so several such occurrences, from any source including `import jmap`, all landed on one target event. It now matches by UID plus `recurrenceId`. - `export-caldav` writes every row that shares a UID in a calendar as one resource, and counts them per row. Before, the second row's `If-None-Match: *` PUT was refused. - `export-files` already wrote each occurrence; the new test now checks that. **Tests** - `tests/mock_dav_occurrences.rs` runs in CI on the in-memory DAV server: import, a re-run, an occurrence added, one withdrawn, export into an empty server, a second export (all skipped), `export-files`, re-import of the exported copy (same rows), and deletion of the resource. **It fails on old main** (Week 2 dropped) and passes here. - A unit test covers the JMAP match key. There's no mock JMAP export test of the full plan. - Live runs: `integration_radicale`, `integration_baikal` and `integration_export_dav` all pass. Checks: fmt, clippy `-D warnings`, `cargo test --locked` (1482 passed).
jcoffey-dev added 1 commit 2026-10-30 15:19:28 +00:00
Keep each occurrence of a series sent without its master
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 4m12s
ci / announce (pull_request) Skipped
af0383165c
An iCalendar resource holding only RECURRENCE-ID occurrences of one UID
(someone invited to single occurrences, not the series) became one row:
import caldav stored the first and dropped the rest. Each occurrence is
now its own row. sync_id_dav names the first; the others are found by
calendar and UID among rows no other item names, so an update reuses,
adds or drops rows as the resource changes, and a vanished resource
takes them all.

On the way out, JMAP export matched events by UID alone, so several
such occurrences (from any source) all landed on one target event; it
now matches by UID and recurrenceId. export-caldav writes every row
sharing a UID in a calendar as one resource, as CalDAV holds them,
counting them per row.

tests/mock_dav_occurrences.rs covers import, change, export, a second
export and re-import on the in-memory DAV server, and fails on the old
code.
jcoffey-dev merged commit 1de694435a into main 2026-10-30 15:24:09 +00:00
jcoffey-dev deleted branch fix/occurrences-without-master 2026-10-30 15:24:09 +00:00
Sign in to join this conversation.