{"record":{"id":"5b71e8da2e431e75","repo":"zed-industries/zed","slug":"user-was-already-invited","errorCode":null,"errorMessage":"user was already invited","messagePattern":"user was already invited","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/call/src/call_impl/mod.rs","lineNumber":493,"sourceCode":"    }\n\n    pub fn global(cx: &App) -> Entity<Self> {\n        Self::try_global(cx).unwrap()\n    }\n\n    pub fn try_global(cx: &App) -> Option<Entity<Self>> {\n        let any = cx.try_global::<GlobalAnyActiveCall>()?;\n        any.0.entity().downcast::<Self>().ok()\n    }\n\n    pub fn invite(\n        &mut self,\n        called_user_id: u64,\n        initial_project: Option<Entity<Project>>,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<()>> {\n        if !self.pending_invites.insert(called_user_id) {\n            return Task::ready(Err(anyhow!(\"user was already invited\")));\n        }\n        cx.notify();\n\n        if self._join_debouncer.running() {\n            return Task::ready(Ok(()));\n        }\n\n        let room = if let Some(room) = self.room().cloned() {\n            Some(Task::ready(Ok(room)).shared())\n        } else {\n            self.pending_room_creation.clone()\n        };\n\n        let invite = if let Some(room) = room {\n            cx.spawn(async move |_, cx| {\n                let room = room.await.map_err(|err| anyhow!(\"{err:?}\"))?;\n\n                let initial_project_id = if let Some(initial_project) = initial_project {","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/call/src/call_impl/mod.rs#L475-L511","documentation":"Returned by invite when called_user_id is already in the pending_invites set, preventing duplicate concurrent invitations to the same user. The invite task resolves immediately with this error instead of sending another request.","triggerScenarios":"Thrown at crates/call/src/call_impl/mod.rs:493 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the in-flight invitation to complete or fail before inviting the same user again","Remove the pending invite entry (e.g. cancel or let it time out) so a new invite can be issued","Deduplicate invite actions in the UI so double-clicks don't fire concurrent invites"],"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-23T08:17:48.524Z"}