fix(ui): Admin login could hang forever on "Logging in..."

AdminScreen's LOGIN phase had no timeout, unlike its COMMAND phase
(_cmd_deadline_ms). If a login reply never arrived -- most commonly a
saved password gone stale after the remote node's password changed,
silently dropped instead of nacked -- the screen stayed stuck with only
a manual Cancel to escape.

sendRoomLogin() now returns the same est_timeout sendAdminCommand()
already exposes; AdminScreen uses it to arm a deadline (poll(),
mirroring the COMMAND-phase pattern) that forgets the stale password
and returns to the picker on expiry, same as an explicit login
rejection already does.

Same fix as hotfix/admin-login-timeout (23f43cac), split out of this
branch's other in-progress work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-07-24 17:56:46 +02:00
co-authored by Claude Sonnet 5
parent a0b1c80c85
commit 176094d32e
4 changed files with 29 additions and 7 deletions
+1 -2
View File
@@ -222,8 +222,7 @@ public:
// command source, so this reuses the same sendLogin() the BLE CMD_SEND_LOGIN
// path uses; the async result lands in onContactResponse() and is pushed to
// the UI via AbstractUITask::onRoomLoginResult().
bool sendRoomLogin(const ContactInfo& contact, const char* password) {
uint32_t est_timeout;
bool sendRoomLogin(const ContactInfo& contact, const char* password, uint32_t& est_timeout) {
if (sendLogin(contact, password, est_timeout) == MSG_SEND_FAILED) return false;
clearPendingReqs();
memcpy(&ui_pending_login, contact.id.pub_key, 4); // match this in onContactResponse()