fix(app): the short reading's nits on the device

- Deleting an identified account whose security can't be read (the
  instance out of reach) says so and deletes nothing; it went on to a
  deletion by the session alone, refused for an account with a password,
  and the person saw a spinner, then nothing. A refusal still leaves the
  session's own deletion.
- InstanceChoice's sharesStorage is required, so no app leaves it out and
  removes a folder another instance uses.
- A PasswordUnlock forgotten is spent: its secrets read again fail
  (StateError) rather than make a proof or a wrapping of zeros.

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-21 18:15:14 +02:00
commit 012f2375a5
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -132,13 +132,23 @@ class const AccountTiles({
try {
security = identified ? await passwords.security() : null;
} on Object catch (error) {
// Unreachable, or anything else (the reading of the fixes: a failure
// that isn't a refusal escaped, and the tap did nothing): deleting
// goes on, and fails as the session bloc says if it must.
if (error is PasswordFailed && error.problem != PasswordProblem.failed) {
// The instance refused to say (no passwords offered there): the
// session's own deletion, which the instance checks.
session.add(const SessionEventDeleteRequested());
return;
}
// Out of reach, or anything else: said so, nothing deleted (the short
// reading: a deletion by the session alone, refused for an account
// with a password, showed a spinner, then nothing).
if (error is! PasswordFailed) {
log('Reading the account failed: ${error.runtimeType}', name: 'Auth');
}
session.add(const SessionEventDeleteRequested());
if (context.mounted) {
ScaffoldMessenger.maybeOf(
context,
)?.showSnackBar(SnackBar(content: Text(l10n.passwordFailed)));
}
return;
}
if (security == null || !security.hasPassword) {