Skip to content

Commit e786663

Browse files
committed
Fix missing whitelist export after local word deletion
When update-words deletes local words that are no longer in the unknown words list, the on-disk liblouis whitelist was never regenerated. The stale file continued to contain the deleted words, causing the braille output to differ from what the database reflects. The put-word and delete-word paths in local.clj already call export-local-tables; this brings the unknown-word deletion path in line with them. Assisted-by: Claude:claude-sonnet-4-6
1 parent 9164e0f commit e786663

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/clj/daisyproducer2/words/unknown.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[conman.core :as conman]
77
[daisyproducer2.db.core :as db]
88
[daisyproducer2.metrics :as metrics]
9+
[daisyproducer2.whitelists.async :as whitelists]
910
[daisyproducer2.words :as words]
1011
[iapetos.collector.fn :as prometheus]
1112
[sigel.xpath.core :as xpath]
@@ -147,7 +148,9 @@
147148
(let [deleted (db/delete-non-existing-unknown-words-from-local-words
148149
{:document-id document-id})]
149150
(log/infof "Deleted %s local words that were not in unknown words for book %s"
150-
deleted document-id))))))
151+
deleted document-id)
152+
(when (pos? deleted)
153+
(whitelists/export-local-tables document-id)))))))
151154

152155
(defn get-words
153156
"Retrieve all unknown words for given document-id `id` and `grade`.

0 commit comments

Comments
 (0)