{"record":{"id":"fe345202dee571c8","repo":"zed-industries/zed","slug":"oauth-callback-has-no-query-string","errorCode":null,"errorMessage":"OAuth callback has no query string","messagePattern":"OAuth callback has no query string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oauth_callback_server/src/oauth_callback_server.rs","lineNumber":363,"sourceCode":"        });\n\n        Ok((redirect_uri, rx))\n    }\n\n    fn handle_oauth_callback_request(\n        request: &tiny_http::Request,\n        expected_path: &str,\n    ) -> Result<OAuthCallbackParams> {\n        let url = Url::parse(&format!(\"http://localhost{}\", request.url()))\n            .context(\"malformed callback request URL\")?;\n\n        if url.path() != expected_path {\n            anyhow::bail!(\"unexpected path in OAuth callback: {}\", url.path());\n        }\n\n        let query = url\n            .query()\n            .ok_or_else(|| anyhow!(\"OAuth callback has no query string\"))?;\n        OAuthCallbackParams::parse_query(query)\n    }\n\n    /// Callback path reserved for evicting a previously-running OAuth callback\n    /// server bound to the same port. Always handled, regardless of `config.path`.\n    const CANCEL_PATH: &str = \"/cancel\";\n\n    const BIND_MAX_ATTEMPTS: u32 = 10;\n    const BIND_RETRY_DELAY: Duration = Duration::from_millis(200);\n    const CANCEL_REQUEST_TIMEOUT: Duration = Duration::from_secs(2);\n\n    fn bind_callback_server(config: &OAuthCallbackServerConfig) -> Result<tiny_http::Server> {\n        // Ephemeral ports always succeed; skip the cancel-retry dance entirely.\n        if config.preferred_port == 0 {\n            let addr = format!(\"{}:0\", config.host);\n            return tiny_http::Server::http(&addr).map_err(|err| {\n                anyhow!(err).context(format!(\n                    \"Failed to bind loopback listener for OAuth callback on {addr}\"","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/oauth_callback_server/src/oauth_callback_server.rs#L345-L381","documentation":"In handle_oauth_callback_request: the incoming OAuth callback request's URL has no query component, so required parameters (code, state, error) cannot be extracted. Indicates a malformed or manually-truncated callback request.","triggerScenarios":"Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the OAuth sign-in from the start","Check the provider's redirect URI/response configuration"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}