Expand description
Replies from your computers to the messages your phone’s notifications brought, through each notification’s own Reply, as the phone’s shade sends a reply typed under it (docs/android.md, “Replies from your computers”). The phone’s side, here and in its listener (AppNotes.java, Replies.java; crates/sioul-app/src/replies.rs):
- Which notification: each line for your computers names the
notification it came in by the phone’s own name for it (
notice: a hash of its app and Android’s key; Android’s key, whose tag may hold a number, never leaves the phone), and a reply names it back. - What it offers (
Live): for each notification it relays, the phone writes in its own shared file,phone-messages/live/<device>.jsonl, whether it offers a Reply the phone can fill and a Mark as read, and when it went; no words, no names. A computer offers Reply only while it can work; the phone checks everything again when it sends. - Handed over (
Due): the background step, which decides each request once, hands the listener what is due in a private file sealed with a key made from the sharing key (due.jsonl, in this phone’srepliesfolder of its state). The listener alone holds the notifications: it takes each once (take: “taken” written and flushed before anything is sent), finds the live notification, has it checked (check: the same app, notification and conversation; their newer messages), sends through its Reply or its Mark as read alone, and says what happened (Done, never the words). - Asked, once (
Ask,verdict): each computer writes its requests in its own file,phone-messages/ask/<computer>.jsonl, each line padded and sealed with a key made from the sharing key, its writer sealed in it (and copied to the sharing folder, sent on the lane texts use); a line found in another device’s file than its writer’s is passed over. The ledger’s mark is made at every phone step and when the listener relays a line for your computers (mark_ledger). The phone decides each once by the texts’ rules (a ledger flushed before the listener is asked, a mark, a request’s life of a quarter of an hour, the doubt after a crash), with two guards of its own; and says what became of each in its ownphone-messages/outcome/<phone>.jsonl(Outcome), never the words, which a computer says in words (state_of), never a plain “Sent”. - On a computer’s Porch (
answer_of): a line offers Reply while its phone says the notification’s Reply works, a text goes as one of Sioul’s own where this computer reads them, the replies written there show under their messages with their states. A conversation answered comes through at once on the phone for twenty minutes after (note_answered,answered_lately), never during a pause.
Structs§
- Answer
- What a Porch’s line offers a reply from this computer (decision 14).
- Answered
- What this computer answered lately, for its Porch (decision 18): the
conversations its replies went to, handed or shown within
ANSWERED_MS(the phone, the conversation’s key), and the numbers it texted then. Their lines show at once, as their phone lets them through, but in a pause. - Ask
- A request a computer writes for a phone (decision 2 of the design): a reply’s words for a notification’s Reply, a Mark as read, or a request taken back. Nothing else can be asked: there is no field for an action, an app’s key or an address.
- Done
- What the listener did with one (
DONE), never its words. - Due
- A reply or a Mark as read due now, as the background step claimed it
(in
DUE, sealed): what the listener needs to find the notification and check it, and the words. - File
Read - A file’s lines read at a step (
read_asks_after), fromstart: each with where it ends, its hash, the request’s key and phone (“” for a line that does not open, or another writer’s). - Judge
- What the phone judges a request by.
- Live
- What a relayed notification offers now, a line in its phone’s own file
(
LIVE), shared: whether a Reply the phone can fill and a Mark as read are there, and when it went. No words, no names. - Mine
- A reply written on this computer, under the messages it answers.
- Offer
- What a computer knows for a Porch’s line’s answer.
- Outcome
- A phone’s word on a request (decision 10): never the words.
- Read
Mark - A file of requests done with up to
offsetbytes, its last line done with by its hash (line): read from there while the file still holds that line there, else whole again (rewritten, trimmed). - State
- A request’s state as a computer says it (decision 10): never red, never “sent” nor “delivered”, which the phone cannot know of another app.
Enums§
- Checked
- What the live notification found for a due one says (
check). - Taken
- Whether the listener may send one now (
take). - Verdict
- What the phone does with a request (decision 3), the texts’ rules.
Constants§
- ANSWERED
- The conversations answered from a computer lately, in the phone’s private replies folder: each conversation’s key (a hash) and until when its messages come through at once (decision 18).
- ANSWERED_
MS - A conversation answered from a computer comes through at once this long after the reply was handed, as a second call within a quarter of an hour rings: their answer to your answer is not held. Never during a pause.
- ASK
- The folder of each computer’s requests (
Ask), under the phone’s messages: each computer’s own file, its lines padded and sealed; shared. - DAY_MS 🔒
- A day, in milliseconds.
- DONE
- What the listener did with each (
Done), plain lines without words. - DUE
- What is due, sealed lines (
Due), written by the background step. - FOLDER
- The phone’s private folder for replies, in its state folder: never shared.
- HOUR_MS 🔒
- An hour, in milliseconds.
- LIVE
- The folder of the live lines, each phone’s own file, under the phone’s
messages (
phonemsgs::folder): shared with the part “Messages from your phone”. - MARKS_
READ - The apps whose Reply marks the conversation read, as their sources say (Signal, Telegram, /e/OS’s Message and the QKSMS it comes from): the first reply in each says so.
- NOT_
SENT - What the listener says of a reply that did not go (
Done::state): such a reply never blocks the same words again. - OUTCOME
- The folder of each phone’s word on each request (
Outcome), its own file: shared, never the words. - PAD_
STEP - A request’s line is padded to a multiple of this before it is sealed.
- PER_
HOUR - At most this many replies an hour, from all your computers together.
- READ_
MARKS - How far the phone is done with each file of requests, in its private
folder (
ReadMark): past every line decided, another phone’s, or that does not open (moved_marks). A step reads each file from there (read_asks_after): a computer’s thousands decided already are never opened again. - SAME_
WORDS_ MS - The same words to the same notification are refused this long after the
first, unless the request sends that first one again on purpose; one its
phone said was not sent never counts (
unsent). - SHOWN_
WITHIN_ MS - How long after a reply was handed its app’s notification is looked at
for your words shown as yours (
shows). - STEP_
MAX - At most this many requests decided in one step (
verdict, the rest at the next), taken from each computer in turn (in_turn): a runaway computer’s thousands never hold a step long, nor keep another computer’s reply from its turn. - TAKE_
WITHIN_ MS - A reply the listener did not take this long after the step handed it is
not sent (
take: “late”): its listener was not bound, or had no access. - WORDS_
MAX - A reply’s words: at most this many characters.
Functions§
- add_due
- What is due added to what the listener has not done yet (those done more than a day ago left out), written whole under the folder’s lock.
- answer_
of - A Porch’s line’s answer (
line, of the messagesgroup, oldest first): none for a code’s line, nor for lines from a phone that names no notification (an older Sioul’s: Text back as before). - answered 🔒
- The conversations answered lately, as kept (those past their time left out).
- answered_
lately - Whether a conversation was answered from a computer within
ANSWERED_MS. - answered_
number - A number a computer texted (
phones::key), as the conversations answered keep it (note_answered): a hash, never the number. “” for none. - append_
all_ 🔒flushed - Lines of what the listener did appended together and flushed once; nothing for none.
- append_
flushed 🔒 - A line of what the listener did, appended and flushed to the disk, yours alone.
- check
- Whether the notification found now by its name is still the one a
request answered: the same app and name (
notice), and the same conversation as the line answered, read as when the line was made (appnotes::classify): the same shape (a group or not, a group’s title), then its key; else, for a line without one, the same sender’s number, else name; a line that names none of these never passes. What the shade’s own Reply guarantees, and more: the Reply under a notification is that conversation’s (apps make one per conversation, as Android tells them), and an app that reuses one notification for another conversation is caught. - claim_
of - A request claimed, as the ledger keeps it: the notification’s name, the
words’ hash and the conversation of the line it answers (
talk), for the guards; never the words. - due_of
- What the listener needs of a request claimed: the line it answers, read from this phone’s log (its conversation, who wrote, its time), the words.
- end_of
- A request decided and ended at the step (taken back, expired, clocks,
refused and why), as the ledger keeps it:
refused:same-wordsfor a refusal, its reason after the colon, so that its word can be said again (ends_of). - ends_of
- The step’s decisions the ledger holds from the last day, as outcomes
(
end_of), to say again those a step could not write:say_outcomeswrites each (key, state) once. - holds 🔒
- Whether a file still holds, just before a mark’s offset, the line the mark names.
- in_turn
- The requests for this phone (
here), each computer’s in its own order, one computer’s after another’s in turn. - is_
false 🔒 - is_
final - Whether a state ends a request: no other word of the phone’s follows, but “shown” after “handed”.
- is_zero 🔒
- last_of 🔒
- What a file of live lines said last of each notification.
- line_
hash 🔒 - A sealed line’s name for the marks: a hash of it as written.
- live_
file - A phone’s own live file under
root(the phone’s messages’ folder). - mark_
ledger - The ledger’s mark made once, when there is none (a request written
before it is refused, as for texts: a ledger lost cannot make old
requests new). Made at every phone step, before the requests are read,
and when the listener relays a line for your computers
(
phonemsgs::note): a reply answers such a line, so the mark is older than the first reply. Never moved once made. - moved_
marks - The marks moved past every line done with, in each file’s order: a line
that does not open or is another writer’s, or whose request is done
with (
done, by its key and phone: decided, or another phone’s); the first line not done with stops its file’s mark. Only the files read now keep one. - note_
answered - A conversation answered (its key,
appnotes::talk_key): its messages come through at once untilANSWERED_MSfrom now. Under the folder’s lock. - notice
- A notification’s name off the phone: FNV-1a of its app and Android’s key
for it (
appnotes::talk_key, as AppNotes.talkKey makes it), 16 hex digits. Android’s key holds the app’s tag, which may be a number. - offer
- What a relayed notification offers now, said in its phone’s own file
(
own) when it differs from what the file last said of it, under its lock: one line per change, not per message. Whether a line was written. - open_
ledger - The replies’ ledger (
texts::Ledger, in the private folder), its mark made now when there is none; the folder made private first. - outcomes_
of - What the phone did with each request, from the listener’s words and the step’s verdicts: an outcome per state, never the words.
- padded_
ask - A request as written: its JSON padded with spaces to a multiple of
PAD_STEPbytes, before it is sealed: no reply’s length shows. - private_
dir 🔒 - The private folder made, yours alone (0700 on Unix), before its lock is taken there.
- private_
folder - The phone’s private folder for replies (
FOLDER). - rank 🔒
- How far a state goes, to say the furthest: shown, then handed, then an end, then taken.
- read_
asks - Every computer’s requests under each root (the records’ copy, the sharing folder’s small files, the copy fetched from the server), each with its computer, its sealed writer: each key once, the first root’s first; and the keys each computer took back (“cancel”), by computer and key. A line whose sealed writer is not its file’s device (moved from another device’s file, or written before the writer was sealed) is passed over, a cancel too.
- read_
asks_ after read_asksfor a phone’s step, each file from its mark (marks, by its path) when it still holds the line the mark names, else whole: the requests past the marks, the cancels, and each file’s lines read, to move the marks once the step decided (moved_marks). A line not ended yet (being written) waits for the next step.- read_
done - What the listener did, oldest first.
- read_
due - What is due, as written; a line that does not open (another key, cut) is passed over.
- read_
handed - Whether a Mark as read this computer asked for a notification was handed to its app: the line is then Seen too (decision 13).
- read_
live - What every phone under
rootsaid last of each notification, by phone and notice, within the week the lines are kept. - read_
marks - The marks as kept; none when the file does not read.
- read_
outcomes - Every phone’s outcomes under
root, each with its phone, oldest first. - save_
read_ marks - The marks written whole, beside then put in place.
- say
- What the listener did with one, said: appended, flushed, under the folder’s lock.
- say_
outcomes - Outcomes added to a phone’s own file (
own), each (key, state) once, under its lock. How many were written. - settle
- The listener’s words on claimed requests, for its outcomes; and, under
the folder’s lock, what it never took within
TAKE_WITHIN_MSof the claim said “late” (its listener was not bound), and what it took without a word aftertexts::LOOK_AFTER_MSsaid “doubt”: its app may have it.claimed: the keys the ledger says claimed, with when. - shown_
already - Whether a notification shows those words as yours already, whatever
their time: looked at before the reply is sent (
shows’sbefore). - shows
- Whether a notification shows a reply’s words as the person’s own (its
hash,
words_hash), as Signal and Element add your reply; the phone then says “shown”. A message of yours in the conversation (no sender, or the conversation’s own user) timed after the reply was taken (since, the phone’s clock, a second’s slack); where the notification gives no time, its words there, or in what went through its Reply lately (Extra::history), only when they were not there already before the reply (before,shown_already): an earlier “Oui” of yours never makes a later “Oui” shown. - state_
of - A request’s state in words, from its phone’s outcomes (
outcomes, its key’s): the furthest it went, the latest of those.app: its app’s name as the phone shows it;phone_shared: when the phone last shared (ms), for “Waiting for your phone”;cancel: this computer took it back (Take back), said at once, and said too late when the phone had taken it already;time_of: a moment (ms) as the computer says the time. - take
- One taken by the listener, once, under the folder’s lock: “taken”
written and flushed before anything is sent, so that a crash after it
leaves the doubt, never a second sending. Not due, or done already:
nothing. Handed over more than
TAKE_WITHIN_MSago: “late”, not sent. - trim_
private - The private files old lines are taken out of, a day on: what is due and
done; the ledger keeps its keys
texts::LEDGER_KEPT_MS. - trim_
shared - The requests and outcomes kept past
phonemsgs::KEPT_DAYStaken out of this device’s own files underroot, those of other devicesphonemsgs::LATE_DAYSlater (a computer gone for good never takes its own out): the sharing then takes them out everywhere. The requests are sealed: each opened to read its time, one that does not open kept. - unsent
- The requests the listener said were not sent (
NOT_SENT), from its words in the private folder (a day of them: longer than the guards look back). - verdict
- The never-twice decision for a reply, step by step: another phone’s (or
a “cancel”); decided already; taken back by its computer; asked by a
device the sharing no longer counts; refused (another verb, no words or
too many, a line not in this phone’s log or of another notification, a
code’s line, its app’s answers switched off, a short number or a sender
named in letters in the SMS app); written before the ledger’s mark;
dated ahead of the phone’s clock; older than
texts::EXPIRY_MS; the two guards (the same words to the same notification withinSAME_WORDS_MS, from a reply that went or may still go, unless it sends the first again;PER_HOURreplies claimed in the last hour); else sent. The time written is corrected by how far the writer’s clock may run ahead.deviceis the request’s sealed writer (read_asks). - waiting
- What is due that the listener has not taken yet: each due line with no word of it.
- went
- A relayed notification gone from the phone, said once in its phone’s own
file (
own), under its lock: only one the file says is there. Whether a line was written. - went_
keys - The requests the listener said went: handed to their app, or shown.
- words_
hash - A reply’s words as the phone compares them, never kept: a hash.
- write_
ask - A request added to its computer’s own file under
root(the phone’s messages’ folder), its writer (device) sealed in it, padded and sealed, under its lock: once by its key and verb. - write_
due - What is due written whole (each line sealed), beside then put in place, under the folder’s lock: the listener reads it whole or not at all.