feat: a dictionary's corrections reach the cards made from it, by offer
All checks were successful
CI / check (push) Successful in 12m33s
CI / deploy (push) Successful in 1m26s

Every dictionary entry now has a version: 16 hex digits of the SHA-256 of
what cards take of it (headword, reading, entry), made by the loader and
carried on every hit. A card keeps the version it took (card schema 8).
DictionaryEndpoint.changed returns, of the entries named with the
versions cards keep (1,000 at most a call; the app asks 500 at a time),
those whose version is another now.

The card browser says how many cards are behind their dictionary and takes
the corrections at a tap (decided 2026-10-09: by offer, never by
themselves). Taking one writes the entry as it is now over the revision
in which the card last took it, beside whatever came after, so the
revisions merge per side as two devices' edits do (ADR 0003): a side only
the dictionary changed takes the correction, a side the person changed
too is a conflict settled in the composer, whose words now name that
case. Cards made before versions are never offered one.

The server rereads its dictionary folder hourly now, not daily: the
dictionaries service fills its volume after an instance's first start,
and an hour with nothing changed costs a hash of each file.

Migration 20261009145434785-dictionary-entry-version: adds
dictionary_entry.version, text NOT NULL DEFAULT '' (rows loaded before
have none and are never reported as corrected), and by hand empties
dictionary_source."fileHash", so every source loads once more and its
entries get their versions; the schema stays as definition.sql says. The
old server goes on working until the switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-09 17:32:00 +02:00
commit 44cee0d6c6
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -2968,6 +2968,12 @@ abstract class AppLocalizations {
/// **'Dictionary entry'**
String get cardDictionaryEntry;
/// No description provided for @cardDictionaryVersion.
///
/// In en, this message translates to:
/// **'Dictionary version'**
String get cardDictionaryVersion;
/// No description provided for @studysetFromDictionary.
///
/// In en, this message translates to:
@ -3208,6 +3214,36 @@ abstract class AppLocalizations {
/// **'Characters from {sources}.'**
String dictionaryCharacterCredits(String sources);
/// No description provided for @dictionaryUpdatesBehind.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 card is behind the dictionary: its entry was corrected since it was made.} other{{count} cards are behind the dictionary: their entries were corrected since they were made.}}'**
String dictionaryUpdatesBehind(int count);
/// No description provided for @dictionaryUpdatesTake.
///
/// In en, this message translates to:
/// **'Take the corrections'**
String get dictionaryUpdatesTake;
/// No description provided for @dictionaryUpdatesTaken.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 card updated.} other{{count} cards updated.}}'**
String dictionaryUpdatesTaken(int count);
/// No description provided for @dictionaryUpdatesToSettle.
///
/// In en, this message translates to:
/// **'{count, plural, =1{One has a change of yours there too: open it to choose.} other{{count} have a change of yours there too: open them to choose.}}'**
String dictionaryUpdatesToSettle(int count);
/// No description provided for @dictionaryUpdatesFailed.
///
/// In en, this message translates to:
/// **'Couldn\'t take the corrections. Try again.'**
String get dictionaryUpdatesFailed;
/// No description provided for @kanjiStrokeOrder.
///
/// In en, this message translates to:
@ -3793,7 +3829,7 @@ abstract class AppLocalizations {
/// No description provided for @composerConflict.
///
/// In en, this message translates to:
/// **'This flashcard was changed differently on two devices. Choose the version to keep of each part below.'**
/// **'This flashcard was changed in two ways at once: on two of your devices, or by you and by a correction from the dictionary. Choose the version to keep of each part below.'**
String get composerConflict;
/// No description provided for @composerKeepThis.