diff --git a/src/slic3r/Utils/MoonrakerPrinterAgent.cpp b/src/slic3r/Utils/MoonrakerPrinterAgent.cpp index 8494eb5cfd..025f0ba918 100644 --- a/src/slic3r/Utils/MoonrakerPrinterAgent.cpp +++ b/src/slic3r/Utils/MoonrakerPrinterAgent.cpp @@ -1415,16 +1415,8 @@ void MoonrakerPrinterAgent::announce_printhost_device() } } - // Try to fetch actual device name from Moonraker - // Priority: 1) Moonraker hostname, 2) Preset model name, 3) Generic fallback - std::string dev_name; - MoonrakerDeviceInfo info; - std::string fetch_error; - if (fetch_device_info(device_info.base_url, device_info.api_key, info, fetch_error) && !info.dev_name.empty()) { - dev_name = info.dev_name; - } else { - dev_name = device_info.model_name.empty() ? "Moonraker Printer" : device_info.model_name; - } + // Never asks the printer, since discovery runs on the GUI thread and an unreachable printer would freeze it + const std::string dev_name = device_info.model_name.empty() ? "Moonraker Printer" : device_info.model_name; const std::string model_id = device_info.model_id; diff --git a/tests/slic3rutils/test_moonraker_printer_agent.cpp b/tests/slic3rutils/test_moonraker_printer_agent.cpp index d3559cea1f..d3d61903fb 100644 --- a/tests/slic3rutils/test_moonraker_printer_agent.cpp +++ b/tests/slic3rutils/test_moonraker_printer_agent.cpp @@ -420,12 +420,13 @@ TEST_CASE("Moonraker discovery waits for a complete device identity", "[Moonrake agent.device_info.dev_id = "127.0.0.1:7125"; agent.device_info.dev_ip = agent.device_info.dev_id; agent.device_info.base_url = "http://127.0.0.1:7125"; + agent.device_info.model_name = "Test model"; agent.start_discovery(true, false); REQUIRE(announcements == 1); - REQUIRE(agent.fetch_count == 1); + REQUIRE(agent.fetch_count == 0); REQUIRE(announcement.at("dev_id") == agent.device_info.dev_id); REQUIRE(announcement.at("dev_ip") == agent.device_info.dev_ip); - REQUIRE(announcement.at("dev_name") == "Test printer"); + REQUIRE(announcement.at("dev_name") == "Test model"); } TEST_CASE("Stopping the status stream gives a silent printer no more than its timeouts", "[MoonrakerPrinterAgent][StatusStream]")