{"record":{"id":"e7f1f74269d0bd55","repo":"slint-ui/slint","slug":"uninitialized-platform-e7f1f7","errorCode":null,"errorMessage":"uninitialized platform","messagePattern":"uninitialized platform","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/testing/systest.rs","lineNumber":36,"sourceCode":"    state: Rc<IntrospectionState>,\n    message_loop_future: std::cell::OnceCell<i_slint_core::future::JoinHandle<()>>,\n    server_addr: String,\n}\n\nimpl TestingClient {\n    fn new(state: Rc<IntrospectionState>) -> Option<Rc<Self>> {\n        let Ok(server_addr) = std::env::var(\"SLINT_TEST_SERVER\") else {\n            return None;\n        };\n\n        Some(Rc::new(Self { state, message_loop_future: Default::default(), server_addr }))\n    }\n\n    fn start_if_needed(self: &Rc<Self>) {\n        let this = self.clone();\n        self.message_loop_future.get_or_init(|| {\n            i_slint_core::with_global_context(\n                || panic!(\"uninitialized platform\"),\n                |context| {\n                    let this = this.clone();\n                    context\n                        .spawn_local(async move {\n                            message_loop(&this.server_addr, |request| {\n                                let this = this.clone();\n                                Box::pin(async move { this.handle_request(request).await })\n                            })\n                            .await;\n                        })\n                        .unwrap()\n                },\n            )\n            .unwrap()\n        });\n    }\n\n    async fn handle_request(","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/internal/backends/testing/systest.rs#L18-L54","documentation":"TestingClient.start_if_needed lazily starts the message-loop future that drives the system-test (protobuf/TCP) client; this panic fires when the code tries to start the loop but the platform handle is absent (uninitialized testing backend or already-torn-down platform). It guards the internal invariant that the simulated event loop can only run on top of an initialized platform.","triggerScenarios":"Thrown at internal/backends/testing/systest.rs:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Initialize the testing backend (init_no_event_loop or init_integration_test_with_mock_time) before creating TestingClient or starting its message loop","Confirm SLINT_TEST_SERVER is set; the client returns None silently when it is absent, and later uses assume a live platform","Ensure start_if_needed runs only after the platform is set; move the call after init in the test harness"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}