Downloaded or deleted dictionary is only used after the app process restarts
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Kotlin
- Star
- 1k
- Fork
- 59
- Merge trung bình
- 14 giờ 9 phút
- Pull request đã merge (30 ngày)
- 56
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của LeanBitLab/LeanType
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
LeanBitLab/LeanType#766 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Silence timeout doesn't close interface and start transcription; causes silent loss of dictated speech.Có thể đã có người làm @LeanBitLab đã nhận 1 ngày trước. Đang mởbug
LeanBitLab/LeanType#765 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[issue] Tamil Keyboard issueĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
LeanBitLab/LeanType#764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
LeanBitLab/LeanType#757 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
More suggestions based on version 1.0.1 of the CJK pluginCó thể đã có người làm @LeanBitLab đã nhận 2 ngày trước. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
LeanBitLab/LeanType#754 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của LeanBitLab/LeanType
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
keiyoushi/extensions-source#20713 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AAswordman/Operit#1457 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
JetBrains/klibs-io#606 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python: zadd stringifies bytes/bytearray/memoryview members (silent data corruption), including in BatchCó thể đã có người làm @prateek-kumar-improving đã nhận hôm nay. Đang mởbug 🐞 python 🐍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
valkey-io/valkey-glide#7521 ·
Maintainer thường phản hồi trong vòng 1 ngày