Prevent loss of user access code on LAN reselect

Keep user access code intact to maintain access rights even if
device slot is unpopulated, ensuring continuous connection
and status message reception.
This commit is contained in:
Andrew
2026-06-24 15:31:46 +08:00
committed by Ian Chua
parent 9b3a44b339
commit 367fcce634

View File

@@ -2166,7 +2166,12 @@ void GUI_App::init_networking_callbacks()
obj->is_tunnel_mqtt = tunnel;
obj->command_request_push_all(true);
obj->command_get_version();
obj->erase_user_access_code();
// Do NOT erase user code. Erasing will cause has_access_right to be false
// whenever the device slot isn't populated yet (e.g. LAN reselect after logout).
// This filters this printer out of get_my_machine_list, silently dropping every status message
// AND the get_access_code reply that would refill the code, leaving a permanently
// dead "connected but no live data" state.
// obj -> set_user_access_code("");
obj->command_get_access_code();
if (m_agent)
m_agent->install_device_cert(obj->get_dev_id(), obj->is_lan_mode_printer());