{"record":{"id":"ff97c0d6598b9c50","repo":"zed-industries/zed","slug":"could-not-find-call-to-decline","errorCode":null,"errorMessage":"could not find call to decline","messagePattern":"could not find call to decline","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/rooms.rs","lineNumber":242,"sourceCode":"        expected_room_id: Option<RoomId>,\n        user_id: UserId,\n    ) -> Result<Option<TransactionGuard<proto::Room>>> {\n        self.optional_room_transaction(|tx| async move {\n            let mut filter = Condition::all()\n                .add(room_participant::Column::UserId.eq(user_id))\n                .add(room_participant::Column::AnsweringConnectionId.is_null());\n            if let Some(room_id) = expected_room_id {\n                filter = filter.add(room_participant::Column::RoomId.eq(room_id));\n            }\n            let participant = room_participant::Entity::find()\n                .filter(filter)\n                .one(&*tx)\n                .await?;\n\n            let participant = if let Some(participant) = participant {\n                participant\n            } else if expected_room_id.is_some() {\n                return Err(anyhow!(\"could not find call to decline\"))?;\n            } else {\n                return Ok(None);\n            };\n\n            let room_id = participant.room_id;\n            room_participant::Entity::delete(participant.into_active_model())\n                .exec(&*tx)\n                .await?;\n\n            let room = self.get_room(room_id, &tx).await?;\n            Ok(Some((room_id, room)))\n        })\n        .await\n    }\n\n    pub async fn cancel_call(\n        &self,\n        room_id: RoomId,","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/rooms.rs#L224-L260","documentation":"decline_call searches for a room participant row for the user with no answering connection (i.e. a pending incoming call); when no such row exists the call was already answered, cancelled, or never placed, so there is nothing to decline.","triggerScenarios":"Thrown at crates/collab/src/db/queries/rooms.rs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as a no-op if the call no longer exists (already answered/cancelled)","Refresh call state before attempting to decline"],"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"}