refactor(app): studysets and settings are written in the newest schema
Decided 2026-10-07: the codecs write the newest schema every time, as before, rather than the oldest one that holds what is there. An older app loses sight of a studyset or of the settings once a newer one has written them, until it is updated too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
a822763df8
commit
ad28a5d8c2
1 changed files with 19 additions and 26 deletions
|
|
@ -181,11 +181,14 @@ void main() {
|
|||
expect(decodeSettingsPayload(payload), settings);
|
||||
});
|
||||
|
||||
test('as they come, are written in the third schema, which older apps '
|
||||
'read', () {
|
||||
final payload = encodeSettingsPayload(const PersonSettings());
|
||||
test('as they come, are left out, in the fourth schema all the same', () {
|
||||
final payload = decodePayload(
|
||||
encodeSettingsPayload(const PersonSettings()),
|
||||
newestSchema: 4,
|
||||
);
|
||||
|
||||
expect(decodePayload(payload, newestSchema: 4)['schemaVersion'], 3);
|
||||
expect(payload['schemaVersion'], 4);
|
||||
expect(payload.keys, isNot(contains('pomodoro')));
|
||||
});
|
||||
|
||||
test('that are malformed read as they come, keeping the other '
|
||||
|
|
|
|||
Loading…
Reference in a new issue