fix(privacy): Finish shows what it would take in, and takes in exactly that (ADR 0019)
The final reading of 22 Oct found that Finish's question said only how many edits of each kind there were, so the person couldn't see content the instance planted, and that taking them in sealed whatever was unsigned when it ran, answers included without being counted. The dialog now lists each edit with its kind and what it says (answers too), and taking them in seals exactly the rows listed, each only while it still says what was shown; one that came or changed after the list stays locked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
92ff7616a4
commit
c9c6533afc
1 changed files with 434 additions and 243 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:halkyon_learn_flutter/src/core/privacy/model/unsigned_edit.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/studyset/data/studyset_gateway.dart';
|
||||
|
||||
/// A [StudysetGateway] in memory: ids are `studyset-1`, `studyset-2`, …, and
|
||||
|
|
@ -77,18 +78,18 @@ class FakeStudysetGateway() implements StudysetGateway {
|
|||
@override
|
||||
bool keysMissing = false;
|
||||
|
||||
/// The unsigned edits each studyset holds, by kind.
|
||||
final unsigned = <String, Map<String, int>>{};
|
||||
/// The unsigned edits each studyset holds.
|
||||
final unsigned = <String, List<UnsignedEdit>>{};
|
||||
|
||||
/// The studysets whose unsigned edits were taken in.
|
||||
final adopted = <String>[];
|
||||
|
||||
@override
|
||||
Future<Map<String, int>> unsignedEditsOf(String id) async =>
|
||||
unsigned[id] ?? const {};
|
||||
Future<List<UnsignedEdit>> unsignedEditsOf(String id) async =>
|
||||
unsigned[id] ?? const [];
|
||||
|
||||
@override
|
||||
Future<int> adoptUnsignedEdits(String id) async {
|
||||
Future<int> adoptUnsignedEdits(String id, List<UnsignedEdit> listed) async {
|
||||
adopted.add(id);
|
||||
unsigned.remove(id);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue