Repository navigation
fix(android): save API key off the UI thread - #212
Merged
Merged
Conversation
SBogorad
force-pushed
the
issue-199-android-api-key-off-main-thread
branch
from
November 1, 2026 22:58
200b0f7 to
6d52730
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
Сохранение API-ключа на Android больше не выполняется на UI-потоке: запись файла вынесена в рабочий поток, а результат применяется через
upgrade_in_event_loop— по той же схеме, что уже используетandroid_start_refresh.Как проверить
Все четыре команды завершаются с кодом 0.
Детали
on_save_api_keyбольше не вызываетandroid_save_api_keyсинхронно. Раньшеfs::create_dir_all+fs::writeшли прямо в колбэке Slint, то есть на главном потоке Android.AndroidApiKeySaveState(Rejected/Saved/Error) и чистая функцияandroid_api_key_save_state. Решение отделено от файловой записи, поэтому проверяется тестами без Android-окна и без реального диска.android_apply_api_key_saveприменяет состояние к окну и обновляетkey_state.Границы
Это не закрывает всю проблему ANR из #199. Диагностика в комментарии показала, что артефакт из описания — debug-сборка на 381 МБ против release-test на 6.1 МБ, и основной вклад в ANR даёт именно профиль сборки. Правка workflow-файла по AGENTS.md §3.2 требует отдельного issue и в этот PR не входит.
Closes #199