{"record":{"id":"f25cffbd98b6b363","repo":"zed-industries/zed","slug":"authentication-canceled","errorCode":null,"errorMessage":"authentication canceled","messagePattern":"authentication canceled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/client/src/client.rs","lineNumber":939,"sourceCode":"                    match authenticate {\n                        Ok(creds) => {\n                            if IMPERSONATE_LOGIN.is_none() {\n                                self.credentials_provider\n                                    .write_credentials(creds.user_id, creds.access_token.clone(), cx)\n                                    .await\n                                    .log_err();\n                            }\n\n                            credentials = Some(creds);\n                        },\n                        Err(err) => {\n                            self.set_status(Status::AuthenticationError, cx);\n                            return Err(err);\n                        }\n                    }\n                }\n                _ = status_rx.next().fuse() => {\n                    return Err(anyhow!(\"authentication canceled\"));\n                }\n            }\n        }\n\n        let credentials = credentials.unwrap();\n        self.set_id(credentials.user_id);\n        self.cloud_client\n            .set_credentials(credentials.user_id as u32, credentials.access_token.clone());\n        self.state.write().credentials = Some(credentials.clone());\n        self.set_status(\n            if is_reauthenticating {\n                Status::Reauthenticated\n            } else {\n                Status::Authenticated\n            },\n            cx,\n        );\n","sourceCodeStart":921,"sourceCodeEnd":957,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/client/src/client.rs#L921-L957","documentation":"During interactive sign-in, the client races the credentials future against the client's own status event stream. If a new connection status arrives first (e.g. disconnect or error), sign-in is aborted with 'authentication canceled' — the credential flow never completed because the underlying connection state changed.","triggerScenarios":"The status_rx stream yields while waiting for OAuth credentials: network drop mid sign-in, server closing the connection, the client reconnecting, or the sign-in prompt flow being torn down.","commonSituations":"Flaky Wi-Fi during browser-based sign-in; corporate proxies resetting long-lived connections; retrying sign-in while a previous attempt is still winding down.","solutions":["Check your network connection and retry sign-in","Make sure only one sign-in attempt runs at a time (close other Zed windows mid-auth)","If it repeats, check whether a proxy or VPN terminates the connection to zed.dev during auth"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.sign_in(provider, cx).await {\n    Ok(creds) => Ok(creds),\n    Err(err) if err.to_string() == \"authentication canceled\" => {\n        // transient: connection status changed mid-flow; retry once after reconnect\n        client.wait_for_status(Status::Connected, cx).await?;\n        client.sign_in(provider, cx).await\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Do not trigger sign-in while the client is visibly reconnecting","Keep a stable network path during browser-based auth flows","Handle this error as retryable rather than fatal in wrappers"],"tags":["authentication","sign-in","client","network"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}