{"record":{"id":"cd6ca648600884a5","repo":"zed-industries/zed","slug":"waitasync-result-missing-value","errorCode":null,"errorMessage":"waitAsync result missing 'value'","messagePattern":"waitAsync result missing 'value'","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_web/src/dispatcher.rs","lineNumber":134,"sourceCode":"                    Ok(result) => result,\n                    Err(error) => {\n                        log::error!(\"Atomics.waitAsync failed: {error:?}\");\n                        break;\n                    }\n                };\n\n                let is_async = js_sys::Reflect::get(&result, &JsValue::from_str(\"async\"))\n                    .ok()\n                    .and_then(|v| v.as_bool())\n                    .unwrap_or(false);\n\n                // `async: false` means the signal changed between the store and\n                // the wait (\"not-equal\"): work has already arrived, so skip\n                // waiting and drain immediately.\n                if is_async {\n                    let promise: js_sys::Promise =\n                        js_sys::Reflect::get(&result, &JsValue::from_str(\"value\"))\n                            .expect(\"waitAsync result missing 'value'\")\n                            .unchecked_into();\n\n                    let _ = wasm_bindgen_futures::JsFuture::from(promise).await;\n                }\n\n                mailbox.drain(&window);\n            }\n        });\n    }\n}\n\npub struct WebDispatcher {\n    main_thread_id: std::thread::ThreadId,\n    background_sender: PriorityQueueSender<RunnableVariant>,\n    main_thread_mailbox: Arc<MainThreadMailbox>,\n    supports_threads: bool,\n    #[cfg(feature = \"multithreaded\")]\n    _background_threads: Vec<wasm_thread::JoinHandle<()>>,","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_web/src/dispatcher.rs#L116-L152","documentation":"Indicates the JS Atomics.waitAsync call succeeded but the returned result object lacked the expected 'value' property (the waiter promise or value). This means the JS API contract was violated — the runtime returned an object without 'value', so the dispatcher cannot extract the promise to await. Fires only in non-standard/browser-buggy environments where waitAsync returns a malformed result.","triggerScenarios":"Thrown at crates/gpui_web/src/dispatcher.rs:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the JS runtime's Atomics.waitAsync implementation (e.g., browser/Firefox version) and target one implementing the spec completely","Reflect over the result object to log its actual keys and confirm which property is missing","Fall back to Atomics.wait or a setTimeout-based polling loop when the 'value' field is absent"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}