Detailed changes
@@ -692,7 +692,7 @@ impl ProjectCollaborator {
pub struct LeftProject {
pub id: ProjectId,
pub host_user_id: UserId,
- pub host_connection_id: ConnectionId,
+ pub host_connection_id: Option<ConnectionId>,
pub connection_ids: Vec<ConnectionId>,
}
@@ -778,7 +778,7 @@ impl Database {
let left_project = LeftProject {
id: project_id,
host_user_id: project.host_user_id,
- host_connection_id: project.host_connection()?,
+ host_connection_id: Some(project.host_connection()?),
connection_ids,
};
Ok((room, left_project))
@@ -862,7 +862,7 @@ impl Database {
id: collaborator.project_id,
host_user_id: Default::default(),
connection_ids: Default::default(),
- host_connection_id: Default::default(),
+ host_connection_id: None,
});
let collaborator_connection_id = collaborator.connection();
@@ -872,7 +872,7 @@ impl Database {
if collaborator.is_host {
left_project.host_user_id = collaborator.user_id;
- left_project.host_connection_id = collaborator_connection_id;
+ left_project.host_connection_id = Some(collaborator_connection_id);
}
}
drop(collaborators);
@@ -1691,7 +1691,7 @@ async fn leave_project(request: proto::LeaveProject, session: Session) -> Result
tracing::info!(
%project_id,
host_user_id = %project.host_user_id,
- host_connection_id = %project.host_connection_id,
+ host_connection_id = ?project.host_connection_id,
"leave project"
);
@@ -25,7 +25,7 @@ use std::{
};
use tracing::instrument;
-#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize)]
+#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize)]
pub struct ConnectionId {
pub owner_id: u32,
pub id: u32,