Downloaded or deleted dictionary is only used after the app process restarts
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with downloadDictionary() and DownloadableDictionaryRow in DictionaryUtils.kt, then the installed-dictionary delete button in DictionaryDialog.kt. Compare them with the NewDictionaryDialog add-from-file path, which already sends DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION, and trace how that broadcast reaches LatinIME.resetSuggestMainDict(). Done means a downloaded or deleted main dictionary takes effect in the same process, which you can check by typing English words without force-stopping the app.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
After downloading a main dictionary in Settings → Languages & Layouts → Dictionaries → → Download, the keyboard keeps working without it until the app process restarts (force stop / reinstall). Deleting a dictionary there has the same problem: the keyboard keeps using the old one.
We noticed it with German + English (US) via multilingual typing. After downloading the English main dictionary, the keyboard still didn't know English words, and autocorrect turned "weather" into "Werther". The log showed only main:de loaded. After restarting the process, main:en_us was loaded and "weather" was kept.
Cause (from reading the code)
downloadDictionary()inDictionaryUtils.ktand the delete buttons (DownloadableDictionaryRowinDictionaryUtils.kt, installed dictionary row inDictionaryDialog.kt) don't sendDictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION. Adding a dictionary from a file (NewDictionaryDialog) does.- Without the broadcast, the keyboard only reaches
resetDictionaryFacilitatorIfNecessary()(the prefpref_dict_download_link_*changed). That callsresetDictionaries(..., forceReloadMainDictionary = false, ...), which keeps the existing main dictionary of an already existing dictionary group. The log showsresetDictionaries, force reloading main dictionary: false.
Fix that works for us
Send the broadcast after a successful download and after deleting. It triggers LatinIME.resetSuggestMainDict(), which reloads with forceReloadMainDictionary = true:
context.sendBroadcast(Intent(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION))
Tested: download → used right away; delete → gone right away; same process, no restart.
To Reproduce
- Use the keyboard once so its process is running.
- Settings → Languages & Layouts → Dictionaries → English (US) → download "Main dictionary: English (US) (legacy)".
- Type English words in a text field: no English suggestions/corrections until the app is force stopped.
Expected behavior
A downloaded or deleted dictionary takes effect right away.
App version & Flavor
Found in GlassType, my fork based on LeanType 4.3.0 (d634e26), standard flavor. The code is unchanged in current main (0e673e1).
Device Info
- Model: Samsung Galaxy Z Fold 3 (SM-F926B) and Galaxy S23 Ultra (SM-S918B)
- OS version: Android 15 / Android 17
- 主要語言
- Kotlin
- 星號
- 1k
- 分支
- 59
- 平均合併
- 14 小時 9 分鐘
- 30 天內合併 PR
- 56
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
LeanBitLab/LeanType 的其他 Issue
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
LeanBitLab/LeanType#766 ·
維護者通常 1 天內回覆
-
[Bug] Silence timeout doesn't close interface and start transcription; causes silent loss of dictated speech.可能已有人在做 @LeanBitLab 今天認領。 未關閉bug
LeanBitLab/LeanType#765 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 45/100
LeanBitLab/LeanType#764 ·
維護者通常 1 天內回覆
-
enhancement
難度 4/5 3-5 天 新手友好度 30/100
LeanBitLab/LeanType#757 · 7 則留言 ·
維護者通常 1 天內回覆
-
More suggestions based on version 1.0.1 of the CJK plugin可能已有人在做 @LeanBitLab 於 2 天前認領。 未關閉enhancement
難度 4/5 3-5 天 新手友好度 38/100
LeanBitLab/LeanType#754 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 LeanBitLab/LeanType 的全部 Issue
相似的 Issue
-
bug core p3
難度 2/5 1-3 小時 新手友好度 72/100
RunanywhereAI/runanywhere-sdks#1258 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
Kotlin-server-squad/vizcore#278 ·
維護者通常 1 天內回覆
-
Empty blood pressure handled as “null” string in exam edit可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
open-learning-exchange/myplanet#18484 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 90/100
Seb3thehacker/gearslip#71 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
ccch1mneyyy/dsh-Go#426 ·
維護者通常 1 天內回覆