Fix LAN Bambu printer losing its connection when the cloud server connects (#17769)

The server-connected handler selects the agent's current machine again every time the cloud
server connects. For a LAN printer this makes the Bambu network plug-in unsubscribe the device,
which drops the LAN session that selecting the printer opened. A connect still in flight fails
with "called UnSubscribeDevice". One that already succeeded stays down with no connect result, so
the printer shows as connected while every command fails with -4 and Print fails with -4030.

Since #17086, OrcaSlicer connects the last LAN Bambu printer at startup, so a LAN user hits this
on most starts. A cloud reconnect later in a session drops the session the same way.

The selection is a cloud subscription, so a LAN printer does not need it. Move the re-select into
DeviceManager::reselect_cloud_machine(), which skips a LAN-mode printer and behaves as before for
any other machine.

Fixes #17766
This commit is contained in:
Alexander Vander Kelen authored and GitHub committed 2026-11-21 13:01:33 -06:00
1 parent f2eb53ebaa
commit a8a597c6d5
4 files changed
+62 -2

No files matched your search

+4 -2
View File
@@ -2341,12 +2341,14 @@ void GUI_App::init_networking_callbacks()
if (provider != this->get_printer_cloud_provider()) {
return;
}
m_agent->set_user_selected_machine(m_agent->get_user_selected_machine());
if (m_device_manager)
m_device_manager->reselect_cloud_machine();
if (this->is_enable_multi_machine()) {
auto evt = new wxCommandEvent(EVT_UPDATE_MACHINE_LIST);
wxQueueEvent(this, evt);
}
m_agent->set_user_selected_machine(m_agent->get_user_selected_machine());
if (m_device_manager)
m_device_manager->reselect_cloud_machine();
if (m_agent->is_user_login(provider)) {
/*disconnect lan*/