Downloaded or deleted dictionary is only used after the app process restarts
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 70/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Kotlin
- Estrelas
- 1k
- Forks
- 59
- Merge médio
- 14h 9min
- PRs com merge (30d)
- 56
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de LeanBitLab/LeanType
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
LeanBitLab/LeanType#760 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
LeanBitLab/LeanType#763 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 Meio dia Facilidade para iniciantes 62/100
LeanBitLab/LeanType#762 ·
Mantenedores costumam responder em até 1 dia
-
Native crash (SIGSEGV in getSuggestionsNative) when typing with a multilingual secondary languageAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
LeanBitLab/LeanType#759 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[Feature Request] Add "Swipe left on delete key to delete word by word" gesture (like SwiftKey)Abertaenhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
LeanBitLab/LeanType#757 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de LeanBitLab/LeanType
Issues semelhantes
-
Issue: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
OpenAPITools/openapi-generator#25524 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liberation-data/drivine4j#547 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ccch1mneyyy/dsh-Go#381 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
wangzan101/Mika#227 ·
Mantenedores costumam responder em até 1 dia
-
documentation
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
theopenconversationkit/tock#2136 ·
Mantenedores costumam responder em até 1 dia