fix(privacy): a device without the keys writes no content where the account has keys (ADR 0019)

Such a device opens no record, so every tree looks readable to it: it
wrote cards, notes, paths, steps, answers, PDFs and files into private
trees readable. Every content write now asks for its key through one place
that refuses there (keyToWriteIn, and each item's write key), before any
row is inserted; reading is unchanged. That the account has keys is kept
once this device saw key rows, so withholding them later and answering no
changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-22 11:48:10 +02:00
commit bb44a7d65d
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -34,6 +34,9 @@ class FakeAssetSealing({
@override
Future<String?> keyOfStudyset(String studysetId) async => keys[studysetId];
@override
Future<String?> keyToWriteIn(String studysetId) async => keys[studysetId];
@override
Future<String?> keyOfItem(ItemKind kind, String id) async => itemKeys[id];