Downloaded or deleted dictionary is only used after the app process restarts
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 70/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Kotlin
- Estrellas
- 1k
- Forks
- 59
- Merge medio
- 14 h 9 min
- PR fusionados (30 d)
- 56
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LeanBitLab/LeanType
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
LeanBitLab/LeanType#766 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Silence timeout doesn't close interface and start transcription; causes silent loss of dictated speech.Posiblemente ocupada @LeanBitLab la tomó hoy. Abiertobug
LeanBitLab/LeanType#765 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[issue] Tamil Keyboard issueAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
LeanBitLab/LeanType#764 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
LeanBitLab/LeanType#757 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
More suggestions based on version 1.0.1 of the CJK pluginPosiblemente ocupada @LeanBitLab la tomó hace 2 días. Abiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
LeanBitLab/LeanType#754 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de LeanBitLab/LeanType
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Kotlin-server-squad/vizcore#278 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
open-learning-exchange/myplanet#18484 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Seb3thehacker/gearslip#71 ·
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
embabel/embabel-agent#2217 ·
Los mantenedores suelen responder en 2 días