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

@ -70,13 +70,13 @@ void main() {
expect(json(payload)['schemaVersion'], studysetSchemaVersion);
});
test('without study options still writes the second schema, which '
'older apps read', () {
test('without study options writes the third schema all the same', () {
final payload = encodeStudysetPayload(
StudysetContent(title: 'Japanese', description: RichContent.empty()),
);
expect(json(payload)['schemaVersion'], 2);
expect(json(payload)['schemaVersion'], 3);
expect(json(payload).keys, isNot(contains('study')));
});
test('keeps the study options', () {