Skip to main content

Module dose_reminders

Module dose_reminders 

Source
Expand description

What each device did to remind each dose (docs/health.md, “What became of a reminder”): $XDG_STATE_HOME/sioul/health-reminders.toml, in the sharing’s health part.

The rule it serves: a dose’s reminder is plain only on the device that knows it is the dose’s first; every other reminder says the doubt first, “Check first”. A device knows it only from what the others wrote here, so each writes, for each dose, before each notice of it goes (maybe), when one was shown (shown), when its first try surely did not go out (unshown), and what it promises (quiet: no notice of the dose from it until then). Each device writes only its own entry, which travels whole (dose.<key>.<device>): the sharing, where the later word wins entry by entry, never has two devices fighting over one.

A file of its own, as health-doses.toml is: an older Sioul (0.0.3 to 0.0.5) does not know it, keeps its changes waiting and writes nothing in it; a table of health-state.toml or a field of health-doses.toml would be dropped by its next save, and the sharing would then take it out on every device.

Structs§

DoseReminders
What each device did to remind each dose, by the dose’s key, then the device’s id.
Tried
What one device did to remind one dose (Unix seconds, its own clock; 0: never).

Enums§

Elsewhere
Why a phone’s alarm cannot know it is a dose’s first reminder: a device that may have reminded it before (others).
Others
What the other devices did to remind a dose, as a phone’s alarm reads it.

Constants§

FILE
The file’s name, in Sioul’s state folder.
KEPT_DAYS
How long an entry is kept after its dose was due: the day’s doses, and one more.
NEVER
A promise without end (Tried::quiet): no notice of the dose from this device again.
QUIET_AFTER
How far after since (the dose’s time, or the waking it waited for) a computer that did not keep the doses then sends no notice of it: past a phone’s alarm (health::ALARM_AFTER), its pull, and clocks apart. Its promise says so (Tried::quiet); a computer closed then has it too.
STALE_DAYS
How long after its dose any device takes another device’s entry out (a device forgotten, reinstalled under a new id, gone without a word): far past KEPT_DAYS, beyond any clock’s error (the eighth review’s L6); counted from the newest dose the other devices’ entries name when it is earlier than this device’s clock (save: the ninth review’s P1).

Functions§

due_of 🔒
When a dose was due, from its key (“levo@1800000000”); 0 when it does not say.
others
What the devices other than me did to remind the dose key, to remind from since, as a phone’s alarm reads it at at (docs/health.md, “What became of a reminder”). Of each other device that counts and shares its doses (health::counts):