Expand description
Address books and calendars on disk, as vdir: one folder per collection,
one file per contact (.vcf) or per event (.ics), the collection’s name
and colour in the files displayname and color. pimsync, vdirsyncer,
khal and khard read the same folders
(https://vdirsyncer.pimutils.org/en/stable/vdir.html).
What sync needs to remember, where each file sits on the server and its ETag, lives apart in the state folder: the data folders hold only your contacts and events.
Structs§
- Collection
- One address book or calendar.
- Item
State - One item, as last agreed with the server.
- Move 🔒
- Moved 🔒
- Items moved or made another here, whose old copy’s deletion on its server waits until the new one is there (the review of 22 October 2026, F6: a refused PUT after the DELETE lost the event on every other device).
- Moved
Item 🔒 - Moves 🔒
- Items being moved from one collection to another (an event to another
calendar:
move_item), eachfrom→towritten before the move and taken out after it, so that a move cut short (a crash, Android stopping Sioul) is finished at the next look (finish_moves): never twice, never lost. - State
- What sync knows of a collection: where it is, how far it got, and each item.
Enums§
Constants§
- LOCAL
- The account of collections kept on this computer only.
- OFF 🔒
- The mark of an account switched off, in its folder of each kind.
Functions§
- collections
- Every collection of a kind, from every account, by account then name.
- content_
hash - A short hash of a file’s content, to tell whether it changed since sync.
- crashed 🔒
- Whether a move stops here, as a crash would (tests only).
- create
- A new collection made here: its folder, its name and colour, and a state
that asks the next sync to create it on the server (MKCALENDAR or an
extended MKCOL).
componentssays what a calendar holds (“VTODO” for a task list). Returns it; an id already taken gets a number. - delete_
collection - An empty collection deleted: at once when it was never sent, else hidden until the next sync deletes it on the server. One holding anything stays.
- deletion_
done - The old copy’s deletion done on its server: nothing waits for it any more.
- deletion_
waits_ for - The new item an old one’s deletion on its server waits for, while the
new one is not there yet (
dav: its PUT first, then the DELETE): None once it is, or when nothing waits. - every_
collection - Every collection kept here, those deleted and not yet gone from the server included.
- finish_
moves - Every move cut short, finished: the item there and still here, taken out here (written whole before the note said so), with what goes with it; not there, the move forgotten, the item kept here and what was made for it taken back; gone from here, the move done. Called before each move and each sync of contacts and calendars.
- finish_
moves_ 🔒now finish_moves, the journal’s lock held.- folder_
id - “personal”, “contacts”, “Calendrier%20perso” → a folder name that holds on
every system: letters, digits,
-and_, the rest as_. - follow_
switches - The marks of switched-off accounts made to follow the configuration, on
this device: the mark is this device’s own, while the configuration
travels; an account switched on again elsewhere (or here before, in a
window that died) kept its mark here, and its calendars and address
books, synced all the same, never showed (the phone of 21 October 2026).
on: the accounts switched on;off: those switched off. Whether any mark changed. - holds_
items - The items a collection holds here: events, tasks or contacts.
- kinds_
held 🔒 - The kinds a calendar’s folder holds (“VEVENT”, “VTODO”), read again only when its list of files changed (its time and count), else as last read.
- move_
item - An item moved to another collection’s folder as
to(21 October 2026): noted first, then written there, then taken out here, then the note gone; a step cut short is finished byfinish_moves. Its sync sends the new item and the deletion, whatever their accounts (this device’s own calendar to a server’s: the event reaches your other devices). - moved_
change 🔒 - moved_
here - Whether
newis an item moved or made here whose old copy may still be on its server: never replaced by what the server holds under its UID. - moved_
path 🔒 - moves_
load 🔒 - moves_
path 🔒 - moves_
save 🔒 - new_
is_ 🔒there - Whether the new item of a move is on its server, or needs not be: gone since, kept on this device alone, or in the old one’s own collection.
- new_
name - A new item’s name: unique, and safe as a file name and in a URL.
- note_
moved 🔒 - one_
folder 🔒 - Whether a name (an account’s, a collection’s) is one folder of its own: not “.”, “..”, nor a path (“../x”, “C:”), which would put files elsewhere.
- prepare
- A collection’s folder, made if needed, with its name and colour written for other tools.
- rename_
collection - A collection renamed here; the next sync tells the server.
- replace_
items - Items made another (a task made an appointment, an appointment a task,
21 October 2026):
gone(the first, then what goes with it: a task’s time blocks) replaced byto, written astext, withmadewritten just before it (a time block for the task an event becomes). The same steps as a move: noted,madethentowritten,gonetaken out, the note gone. Cut short beforetois whole,madeis taken back andgonekept; after,goneis taken out (finish_moves): never both, never neither. - replace_
locked 🔒 replace_items, the journal’s lock held.- set_
account_ off - An account’s calendars and address books out of the pages (
off), or back. - settle_
kinds 🔒 - A calendar of this device’s own whose kinds were never written (made
before 21 October 2026 without them, when “unsaid” meant both): what it
holds says them, written once with it (its state,
dav/local/): events alone, tasks alone, or both when it holds both or nothing. A server’s says its own at each sync (supported-calendar-component-set; unsaid, both, as RFC 4791 §5.2.3 has it). - state_
path - Where sync keeps what it knows of a collection.
- write_
item - Writes an item next to its place, then moves it in.