Recover Vial unlock sessions after reconnect#83
Conversation
kissetfall
left a comment
There was a problem hiding this comment.
Two blockers remain on the current main integration.
- The recovery path cannot currently observe VIA protocol
0. Since #92,read_responsevalidates reports on every transport throughresponse_matches_command. TheCMD_VIA_GET_PROTOCOL_VERSIONmatcher only accepts protocol9or0xFFFF, so the echoed0response produced while Vial unlock is active is discarded andget_protocol_version()fails beforeclassify_via_connect()runs.
Please fix this in the HID response-matching owner rather than bypassing validation in the connect task. Preserve stale/unrelated-report rejection, and add a regression test that covers the actual chain: the active-unlock VIA 0 response is accepted by the matcher and then classified as recovery only after get_unlock_status reports (unlocked = false, in_progress = true).
- The new overlay actions use default
egui::Ui::buttoncontrols and place the positive action before the negative action. Entropy's UI contract requires the sharedmodern_buttoncontrol and negative/backward actions first. Please renderCancelbeforeStartusing the reusable button helper.
After these code fixes, this PR still needs the physical Phenom Mini scenario before merge: opening the prompt must not send UNLOCK_START; reconnecting during an active session must resume without a second UNLOCK_START; completion must reload the full keyboard state.
1084b5d to
6335067
Compare
|
Addressed in commit 6335067 and rebased onto current main. |
|
Re-reviewed head 6335067 against current main. Both requested code blockers are resolved:
The recovery path resumes polling without a second UNLOCK_START and reloads the full device state on completion. Local validation passed: 219/219 tests, Clippy, i18n, scoped rustfmt, git diff --check, and release build. CI is 4/4 green. I found no new code blocker. Keeping the existing CHANGES_REQUESTED until the planned physical Phenom Mini retest. Please post the results for these scenarios:
After a successful hardware check, this is ready for approval. |
6335067 to
e81fc15
Compare
kissetfall
left a comment
There was a problem hiding this comment.
The latest head addresses the previous code review findings: the VIA protocol 0 response now passes the HID matcher before classification, and the unlock prompt uses the standard controls in Cancel → Start order.
Two requirements remain before merge:
- Rebase onto the current main branch and resolve the content conflict in src/ui/device_connect_task.rs, preserving the current asynchronous connection and write-state changes from main.
- Validate the recovery flow on a physical Phenom Mini:
- opening and cancelling the prompt must not send UNLOCK_START;
- reconnecting during an active unlock must resume polling without a second UNLOCK_START;
- completing the recovered session must reload the full keyboard layout and settings.
Local result on the current PR head: 226/226 tests pass and the changed Rust files pass rustfmt. Please re-request review after the rebase and hardware smoke test.
e81fc15 to
06fa3f5
Compare
EN
Problem
Diagnostic logs captured Phenom Mini freezes with VIA protocol
0while Vial protocol6and keyboard ID remained valid. A hardware reset restored VIA protocol9. This state matches firmware remaining inside a Vial unlock session, where normal keyboard input is suppressed until unlock finishes or firmware resets.Entropy rejected this state as unsupported during reconnect, before checking Vial unlock status. It could also start the blocking firmware session without a deliberate unlock action because opening a locked Matrix Tester or macro flow immediately sent
UNLOCK_START.Fix
0as recoverable only when Vial reportsunlocked = falseandin_progress = true; every other unsupported VIA response remains an error.UNLOCK_POLLwithout sending anotherUNLOCK_START.This closes Entropy-controlled triggering and reconnect recovery. A firmware timeout/watchdog for host loss remains separate firmware work.
Verification
cargo test --locked: 194 passed.cargo build --locked --release: passed on macOS.cargo clippy --locked --all-targets: passed with existing repository warnings.python3 scripts/check_i18n.py: passed.rustfmt --checkandgit diff --check: passed.Post-Deploy monitoring & validation
UNLOCK_START, and reload full keyboard state.VIA protocol 0 received,Recovering active Vial unlock,Vial UNLOCK_START accepted, andReloading device state after Vial unlock recovery. Repeated recovery loops or VIA0without active Vial status are rollback signals.Related: #68
RU
Проблема
https://t.me/c/1464748383/7588/130869
Диагностические логи зафиксировали зависание Phenom Mini: VIA protocol возвращал
0, при этом Vial protocol6и keyboard ID читались корректно. После аппаратного сброса VIA protocol снова стал9. Такое состояние соответствует незавершенной Vial unlock session в прошивке, во время которой обычный ввод с клавиатуры заблокирован до завершения unlock или сброса прошивки.При reconnect Entropy отклоняла это состояние как неподдерживаемое до проверки Vial unlock status. Кроме того, открытие заблокированного Matrix Tester или macro flow сразу отправляло
UNLOCK_START, поэтому блокирующая firmware session могла начаться без явного действия пользователя.Исправление
0считается восстанавливаемым только если Vial сообщаетunlocked = falseиin_progress = true; остальные неподдерживаемые ответы VIA остаются ошибкой.UNLOCK_POLLбез повторногоUNLOCK_START.Это закрывает запуск блокирующего состояния и reconnect recovery со стороны Entropy. Firmware timeout/watchdog при потере host остаётся отдельной задачей прошивки.
Проверка
cargo test --locked: прошли 194 теста.cargo build --locked --release: прошёл на macOS.cargo clippy --locked --all-targets: прошёл с существующими предупреждениями репозитория.python3 scripts/check_i18n.py: прошёл.rustfmt --checkиgit diff --check: прошли.Проверка после билда
UNLOCK_STARTи заново загрузить полное состояние клавиатуры.VIA protocol 0 received,Recovering active Vial unlock,Vial UNLOCK_START acceptedиReloading device state after Vial unlock recovery. Повторяющийся recovery loop или VIA0без активного Vial status требуют rollback.