fix(dictionary): no language goes missing while the curator updates

The update removed the files of sources no longer wanted first, Korean's
words from Wiktionary among them, before KRDict's replacement was
written, which on the first run after v0.16.0 came after Wiktionary's
3 GB conversion: the server unloaded Korean meanwhile, and for good if
KRDict failed. Removal now comes last, and a replaced source stays until
its replacement is there. A bare curate update, without --languages,
no longer removes every other language. A KRDict export of another
shape (the page's buttons reordered) is refused rather than written as
a dictionary of no words over Korean's. The server never unloads from
an empty dictionaries folder (a volume made anew), and a failed unload
no longer stops the files from loading.

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-14 17:36:55 +02:00
commit d5fe51b296
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -34,6 +34,27 @@ void main() {
];
}
test('an export of another shape is refused rather than written as a '
'dictionary of no words', () async {
for (final files in [
<ArchiveFile>[],
[ArchiveFile.bytes('1_5000_20260919.xml', utf8.encode('<xml/>'))],
[
ArchiveFile.bytes(
'1_5000_20260919.json',
utf8.encode(jsonEncode({'LexicalResource': <String, Object?>{}})),
),
],
]) {
final archive = Archive();
files.forEach(archive.add);
final zip = ZipEncoder().encodeBytes(archive);
final (version: _, :entries) = krdictExport(zip);
await expectLater(entries.toList(), throwsFormatException);
}
});
test("KRDict's words with their level, pronunciation where it differs from "
'the spelling, Hanja, forms and English senses', () async {
final [header, ...entries] = await converted();