Keep a half-written message across a relaunch #40

Merged
paulhitt merged 1 commits from feat/drafts-that-survive into main 2026-09-02 19:50:15 +00:00
paulhitt commented 2026-09-02 10:50:45 +00:00 (Migrated from gitlab.com)

Sealed in the vault, not in SharedPreferences — and that is the whole
point. A draft is plaintext the person has not decided to send, very
often the most sensitive text in the app because it is the thing they
are still weighing. SharedPreferences writes readable XML that survives
into backups; the vault seals it under the conversation's own key with
the record name bound into the AAD, and forgetEverything takes it on
sign-out. There is a test that asserts the bytes on disk do not contain
the text, because the wrong implementation would pass every other test
here.

Keyed by the same threadFor* ids the transcript uses, so a group called
"7", the contact who is user 7, and the address "7" are three
different drafts.

Every write to the composer state goes through one setDraft: send clears
it by assigning directly in three places, and any one of those that
forgot to clear the stored copy would bring the message back next time
as a draft of something already sent.

Closes #47 on iOS side; Android half of the same feature

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Sealed in the vault, not in SharedPreferences — and that is the whole point. A draft is plaintext the person has not decided to send, very often the most sensitive text in the app because it is the thing they are still weighing. SharedPreferences writes readable XML that survives into backups; the vault seals it under the conversation's own key with the record name bound into the AAD, and forgetEverything takes it on sign-out. There is a test that asserts the bytes on disk do not contain the text, because the wrong implementation would pass every other test here. Keyed by the same threadFor* ids the transcript uses, so a group called "7", the contact who is user 7, and the address "7" are three different drafts. Every write to the composer state goes through one setDraft: send clears it by assigning directly in three places, and any one of those that forgot to clear the stored copy would bring the message back next time as a draft of something already sent. Closes #47 on iOS side; Android half of the same feature Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
paulhitt commented 2026-09-02 10:50:45 +00:00 (Migrated from gitlab.com)

assigned to @paulhitt

assigned to @paulhitt
paulhitt commented 2026-09-02 19:50:04 +00:00 (Migrated from gitlab.com)

added 13 commits

  • f053d6c0...1fc1a561 - 12 commits from branch main
  • f95cb1e6 - Keep a half-written message across a relaunch

Compare with previous version

added 13 commits <ul><li>f053d6c0...1fc1a561 - 12 commits from branch <code>main</code></li><li>f95cb1e6 - Keep a half-written message across a relaunch</li></ul> [Compare with previous version](/paulhitt/flamenet-messenger-android/-/merge_requests/13/diffs?diff_id=2000738651&start_sha=f053d6c05cde9d728964b53a4c6b2ab46ef1681b)
paulhitt (Migrated from gitlab.com) merged commit 00c043918f into main 2026-09-02 19:50:16 +00:00
paulhitt commented 2026-09-02 19:50:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 00c043918f

mentioned in commit 00c043918ff6555b3cfbfcada8eaf4442f28464a
Sign in to join this conversation.