{"record":{"id":"7029286f2ebd22e5","repo":"jlcodes99/cockpit-tools","slug":"wakeupgateway-ls-subscribetounifiedstatesynct","errorCode":null,"errorMessage":"[WakeupGateway] 官方 LS SubscribeToUnifiedStateSyncTopic 解析失败: {}","messagePattern":"\\[WakeupGateway\\] 官方 LS SubscribeToUnifiedStateSyncTopic 解析失败: (.+?)","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"crates/cockpit-core/src/modules/wakeup_gateway.rs","lineNumber":1206,"sourceCode":"                crate::modules::logger::log_error(&format!(\n                    \"[WakeupGateway] 官方 LS LanguageServerStarted 解析失败: {}\",\n                    err\n                ));\n                return OfficialLsExtensionAction::Close(text_response(\n                    400,\n                    \"Bad Request\",\n                    &err,\n                    \"text/plain; charset=utf-8\",\n                ));\n            }\n        }\n    }\n\n    if path_matches_rpc_method(&path, \"SubscribeToUnifiedStateSyncTopic\") {\n        let topic = match parse_subscribe_topic_from_connect_body(&parsed.body) {\n            Ok(v) => v,\n            Err(err) => {\n                crate::modules::logger::log_error(&format!(\n                    \"[WakeupGateway] 官方 LS SubscribeToUnifiedStateSyncTopic 解析失败: {}\",\n                    err\n                ));\n                return OfficialLsExtensionAction::Close(text_response(\n                    400,\n                    \"Bad Request\",\n                    &err,\n                    \"text/plain; charset=utf-8\",\n                ));\n            }\n        };\n\n        let topic_bytes = match topic.as_str() {\n            \"uss-oauth\" => &state.uss_oauth_topic_bytes,\n            \"uss-enterprisePreferences\" | \"uss-agentPreferences\" => &state.empty_topic_bytes,\n            _ => &state.empty_topic_bytes,\n        };\n        let update = build_unified_state_sync_update_initial_state(topic_bytes);","sourceCodeStart":1188,"sourceCodeEnd":1224,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/crates/cockpit-core/src/modules/wakeup_gateway.rs#L1188-L1224","documentation":"Parse guard in the official LS extension RPC bridge: a SubscribeToUnifiedStateSyncTopic connect request failed parse_subscribe_topic_from_connect_body, meaning the topic could not be extracted from the request body. The error is logged as '[WakeupGateway] ... 解析失败' and a 400 Bad Request text response is returned; the subscription is not registered.","triggerScenarios":"Thrown at crates/cockpit-core/src/modules/wakeup_gateway.rs:1206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the connect body carries the expected topic field/format","Update parse_subscribe_topic_from_connect_body if the official LS changed its connect payload","Use the logged parse error to pinpoint the malformed field"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}