perf(learn): local reads no longer wait on the instance

Every read of the person's content refreshes their keys, and a refresh
asked the instance whether the account has keys until it once answered
yes, which an account signing in with SimpleLogin alone never does. So
on a poor connection every read waited on a request: the library's
progress, a request per studyset in a row, took over five minutes, and
Home was slow too.

A device holding the keys already knows the account has them, so the
keys now open first and the instance is asked only while no other sign
says so (a device without the keys still asks at every refresh).

Whats-New: The library and Home open quickly again without a good connection.
Whats-New-De: Die Bibliothek und die Startseite öffnen sich ohne gute Verbindung wieder schnell.

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

View file

@ -1,13 +0,0 @@
import 'package:halkyon_learn_flutter/src/feature/studyset/data/private_offer_store.dart';
/// [PrivateOfferStore] in memory.
class MemoryPrivateOfferStore() implements PrivateOfferStore {
/// Whether the offer was answered.
bool isAnswered = false;
@override
Future<bool> answered() async => isAnswered;
@override
Future<void> answer() async => isAnswered = true;
}