{"record":{"id":"3347b59d04958314","repo":"zed-industries/zed","slug":"no-such-project","errorCode":null,"errorMessage":"no such project","messagePattern":"no such project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/rooms.rs","lineNumber":510,"sourceCode":"                    ))),\n                    answering_connection_lost: ActiveValue::set(false),\n                    ..Default::default()\n                })\n                .exec(&*tx)\n                .await?;\n            if participant_update.rows_affected == 0 {\n                return Err(anyhow!(\"room does not exist or was already joined\"))?;\n            }\n\n            let mut reshared_projects = Vec::new();\n            for reshared_project in &rejoin_room.reshared_projects {\n                let project_id = ProjectId::from_proto(reshared_project.project_id);\n                let project = project::Entity::find_by_id(project_id)\n                    .one(&*tx)\n                    .await?\n                    .context(\"project does not exist\")?;\n                if project.host_user_id != Some(user_id) {\n                    return Err(anyhow!(\"no such project\"))?;\n                }\n\n                let mut collaborators = project\n                    .find_related(project_collaborator::Entity)\n                    .all(&*tx)\n                    .await?;\n                let host_ix = collaborators\n                    .iter()\n                    .position(|collaborator| {\n                        collaborator.user_id == user_id && collaborator.is_host\n                    })\n                    .context(\"host not found among collaborators\")?;\n                let host = collaborators.swap_remove(host_ix);\n                let old_connection_id = host.connection();\n\n                project::Entity::update(project::ActiveModel {\n                    host_connection_id: ActiveValue::set(Some(connection.id as i32)),\n                    host_connection_server_id: ActiveValue::set(Some(ServerId(","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/collab/src/db/queries/rooms.rs#L492-L528","documentation":"Thrown by rejoin_room when one of the reshared_projects entries resolves to a project whose host_user_id is not the rejoining user. The project row is fetched with context 'project does not exist' and then ownership is checked; failing ownership returns the deliberately generic 'no such project' so the server does not leak the existence of other users' projects.","triggerScenarios":"Rejoining with a cached project id that was later unshared, deleted, or whose hosting moved to another user; rejoining with a project id belonging to someone else's share; host migration between the disconnect and the rejoin.","commonSituations":"Stale client cache of shared project ids across reconnects; user signed out and back in as a different account but kept the room state; project shared by another host after the original host left.","solutions":["Filter reshared_projects down to projects the client still believes it hosts before sending RejoinRoom","On this error, drop the offending project from the rejoin set and retry the rejoin","Re-share the project (create a fresh share) instead of reusing the stale project id"],"exampleFix":"// before\nrequest.reshared_projects = cached_shared_project_ids(room_id);\nclient.rejoin_room(request).await?;\n\n// after (only rejoin projects this client hosts)\nrequest.reshared_projects = cached_shared_project_ids(room_id)\n    .into_iter()\n    .filter(|id| self.hosted_projects.contains(id))\n    .collect();\nclient.rejoin_room(request).await?;","handlingStrategy":"validation","validationCode":"// Only reshare projects this client currently hosts.\nrequest.reshared_projects = cached_shared_project_ids(room_id)\n    .into_iter()\n    .filter(|id| self.hosted_projects.contains(id))\n    .map(|id| ResharedProject { project_id: id, ..Default::default() })\n    .collect();\nclient.rejoin_room(request).await?;","typeGuard":null,"tryCatchPattern":"match client.rejoin_room(request).await {\n    Ok(rejoin) => Ok(rejoin),\n    Err(err) if err.to_string().contains(\"no such project\") => {\n        request.reshared_projects.clear();\n        client.rejoin_room(request).await // retry without stale shares\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Maintain an accurate hosted-projects set; update it on share/unshare events","Drop reshared project ids when hosting ends or the project is unshared","Re-share projects from scratch instead of reusing cached ids across sessions"],"tags":["rooms","projects","reconnect","rejoin","server"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}