Let an event choose which source it is filed under
An event created in an aggregate went to the configured default_sink and nowhere else, so with several writable sources there was no way to say which calendar a new event belonged in. A line reading @endpoint-id in the description now picks the source, and a matching CATEGORIES value does too. The description rather than the title because every calendar client exposes a notes field and editing it does not disfigure the event's name; CATEGORIES as well because that is the field iCalendar intends, even though many mobile clients hide it. The marker is stripped before the event reaches the calendar, being calcalist's bookkeeping rather than content. A marker naming something that is not a writable source of that aggregate is refused and reported, not redirected to the default: a typo should not quietly file an event in the wrong calendar. A bare address in prose is not a marker either, since a marker must be a line of its own. Also covers the shapes beyond many-into-one: a source feeding several aggregates, several aggregates sharing one target, a cycle between two aggregates, a delete cascading across aggregates, and competing edits arriving through two aggregates at once — the last being caught by the existing conflict detection rather than silently overwriting. Error display no longer repeats itself; thiserror already prints the cause chain. Verified live against real accounts: two Google calendars aggregating into a Posteo calendar, an edit in the aggregate reaching the originating Google calendar, an event routed to a chosen source by its description marker, and a deletion propagating from the aggregate through to Google. 129 tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
bc64f19211
commit
0c0558c24c
6 changed files with 506 additions and 12 deletions
2
SPECS.md
2
SPECS.md
|
|
@ -20,7 +20,7 @@ Every endpoint — sources and aggregate targets alike — is mirrored to a loca
|
|||
| Question | Behaviour |
|
||||
|---|---|
|
||||
| Provenance | Aggregate UIDs derived as `blake3(aggregate_id, source_id, source_uid)`; the state file is a cache, not a single point of failure |
|
||||
| Routing new events | To the aggregate's configured `default_sink`; refused if none is set |
|
||||
| Routing new events | A `@endpoint-id` line in the description, or a matching category, picks the source; otherwise the aggregate's `default_sink`. A hint naming an invalid sink is refused, never redirected to the default |
|
||||
| Conflicts | Source wins — the origin calendar is authoritative |
|
||||
| Deletion | Propagates to the source, guarded by a mass-deletion threshold |
|
||||
| Attendees (mirroring) | Kept verbatim on a Google target; demoted to inert data on a CalDAV target |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue