{"record":{"id":"5d81654bab1b0945","repo":"zed-industries/zed","slug":"user-is-not-a-channel-member-or-channel-does-not-e","errorCode":null,"errorMessage":"user is not a channel member or channel does not exist","messagePattern":"user is not a channel member or channel does not exist","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/channels.rs","lineNumber":765,"sourceCode":"                \"user is not a channel admin or channel does not exist\"\n            ))?,\n        }\n    }\n\n    /// Returns whether the given user is a member of the specified channel.\n    pub async fn check_user_is_channel_member(\n        &self,\n        channel: &channel::Model,\n        user_id: UserId,\n        tx: &DatabaseTransaction,\n    ) -> Result<ChannelRole> {\n        let channel_role = self.channel_role_for_user(channel, user_id, tx).await?;\n        match channel_role {\n            Some(ChannelRole::Admin) | Some(ChannelRole::Member) => Ok(channel_role.unwrap()),\n            Some(ChannelRole::Banned)\n            | Some(ChannelRole::Guest)\n            | Some(ChannelRole::Talker)\n            | None => Err(anyhow!(\n                \"user is not a channel member or channel does not exist\"\n            ))?,\n        }\n    }\n\n    /// Returns whether the given user is a participant in the specified channel.\n    pub async fn check_user_is_channel_participant(\n        &self,\n        channel: &channel::Model,\n        user_id: UserId,\n        tx: &DatabaseTransaction,\n    ) -> Result<ChannelRole> {\n        let role = self.channel_role_for_user(channel, user_id, tx).await?;\n        match role {\n            Some(ChannelRole::Admin)\n            | Some(ChannelRole::Member)\n            | Some(ChannelRole::Guest)\n            | Some(ChannelRole::Talker) => Ok(role.unwrap()),","sourceCodeStart":747,"sourceCodeEnd":783,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/channels.rs#L747-L783","documentation":"A generic authorization sentinel from check_user_is_channel_member: the user's role is not Admin or Member (e.g. Talker, Guest, or Banned), or they have no membership in the channel. Used by update_channel_buffer to gate buffer edits to full members.","triggerScenarios":"Thrown at crates/collab/src/db/queries/channels.rs:765 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Have the user join the channel or be invited as a full member","Check whether the user's role is Guest/Talker/Banned, which do not count as members for this operation"],"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-23T08:17:48.524Z"}