{"record":{"id":"f6378d08feb85707","repo":"zed-industries/zed","slug":"oauth-callback-server-was-shut-down-before-receivi","errorCode":null,"errorMessage":"OAuth callback server was shut down before receiving a response","messagePattern":"OAuth callback server was shut down before receiving a response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/context_server/src/oauth.rs","lineNumber":1103,"sourceCode":"/// redirect URI in the authorization request, open the browser, then await\n/// the future to receive the callback.\n///\n/// The server accepts exactly one request on `/callback`, validates that it\n/// contains `code` and `state` query parameters, responds with a minimal\n/// HTML page telling the user they can close the tab, and shuts down.\n///\n/// The callback server shuts down when the returned future is dropped (e.g.\n/// because the authentication task was cancelled), or after a timeout.\npub fn start_callback_server() -> Result<(String, BoxFuture<'static, Result<OAuthCallback>>)> {\n    let (redirect_uri, rx) = oauth_callback_server::start_oauth_callback_server()?;\n    let future = async move {\n        match rx.await {\n            Ok(Ok(params)) => Ok(OAuthCallback {\n                code: params.code,\n                state: params.state,\n            }),\n            Ok(Err(e)) => Err(e),\n            Err(_) => Err(anyhow!(\n                \"OAuth callback server was shut down before receiving a response\"\n            )),\n        }\n    }\n    .boxed();\n    Ok((redirect_uri, future))\n}\n\n// -- JSON fetch helper -------------------------------------------------------\n\nasync fn fetch_json<T: serde::de::DeserializeOwned>(\n    http_client: &Arc<dyn HttpClient>,\n    url: &Url,\n) -> Result<T> {\n    validate_oauth_url(url)?;\n\n    let request = Request::builder()\n        .method(http_client::http::Method::GET)","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/context_server/src/oauth.rs#L1085-L1121","documentation":"Error \"OAuth callback server was shut down before receiving a response\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/context_server/src/oauth.rs:1103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}