Downloaded or deleted dictionary is only used after the app process restarts
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 70/100
調査の方向性
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分
- マージ済み PR(30日)
- 56
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LeanBitLab/LeanType のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 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 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Kotlin-server-squad/vizcore#278 ·
メンテナーはふだん 1 日以内に返信
-
Empty blood pressure handled as “null” string in exam edit対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
open-learning-exchange/myplanet#18484 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
Seb3thehacker/gearslip#71 ·