Observation
Every setter in lib/packages/repository/settings_repository.dart discards the Future<bool> returned by the underlying SharedPreferences write (language, currency, termsAccepted, softwareTermsAccepted, networkMode, and since #885 insiderFeaturesUnlocked). The SettingsBloc handlers call these setters synchronously and emit the new state immediately, so the UI confirms a change before the write is durably flushed. A failed or interrupted disk write is silently ignored; after a restart the app can be in the pre-change state even though the UI confirmed the change.
Assessment
Practical risk is low — SharedPreferences updates its in-memory cache synchronously and flush failures are rare — and the pattern predates #885; the new insider flag merely follows the established convention. Flagged during the #885 review passes as a hardening candidate rather than a merge blocker.
Proposal
Model the repository setters as Future<void> methods, await them in the (then async) bloc handlers before emitting, and surface a failure instead of confirming success. Success feedback in the UI (e.g. SnackBars) should then move to a BlocListener on the emitted transition so it can no longer outrun persistence.
Observation
Every setter in
lib/packages/repository/settings_repository.dartdiscards theFuture<bool>returned by the underlyingSharedPreferenceswrite (language,currency,termsAccepted,softwareTermsAccepted,networkMode, and since #885insiderFeaturesUnlocked). TheSettingsBlochandlers call these setters synchronously and emit the new state immediately, so the UI confirms a change before the write is durably flushed. A failed or interrupted disk write is silently ignored; after a restart the app can be in the pre-change state even though the UI confirmed the change.Assessment
Practical risk is low —
SharedPreferencesupdates its in-memory cache synchronously and flush failures are rare — and the pattern predates #885; the new insider flag merely follows the established convention. Flagged during the #885 review passes as a hardening candidate rather than a merge blocker.Proposal
Model the repository setters as
Future<void>methods, await them in the (then async) bloc handlers before emitting, and surface a failure instead of confirming success. Success feedback in the UI (e.g. SnackBars) should then move to aBlocListeneron the emitted transition so it can no longer outrun persistence.