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:
Tizian 「ティツィアーン」 2026-10-07 10:21:58 +02:00
commit ad28a5d8c2
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -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 '