chore: remove logs (#986)
This commit is contained in:
parent
9778843746
commit
91b0c50722
|
|
@ -162,7 +162,10 @@ where
|
||||||
if result {
|
if result {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(AppError::NotEnoughPermissions)
|
Err(AppError::NotEnoughPermissions {
|
||||||
|
user: uid.to_string(),
|
||||||
|
workspace_id: workspace_id.to_string(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,10 @@ pub enum AppError {
|
||||||
#[error("Not Logged In:{0}")]
|
#[error("Not Logged In:{0}")]
|
||||||
NotLoggedIn(String),
|
NotLoggedIn(String),
|
||||||
|
|
||||||
#[error("User does not have permissions to execute this action")]
|
#[error(
|
||||||
NotEnoughPermissions,
|
"User:{user} does not have permissions to execute this action in workspace:{workspace_id}"
|
||||||
|
)]
|
||||||
|
NotEnoughPermissions { user: String, workspace_id: String },
|
||||||
|
|
||||||
#[error("s3 response error:{0}")]
|
#[error("s3 response error:{0}")]
|
||||||
S3ResponseError(String),
|
S3ResponseError(String),
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,10 @@ pub async fn delete_workspace_members(
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if is_owner {
|
if is_owner {
|
||||||
return Err(AppError::NotEnoughPermissions);
|
return Err(AppError::NotEnoughPermissions {
|
||||||
|
user: member_email.to_string(),
|
||||||
|
workspace_id: workspace_id.to_string(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
|
|
|
||||||
|
|
@ -206,11 +206,12 @@ impl CollabBroadcast {
|
||||||
|
|
||||||
trace!("[realtime]: send {} => {}", message, cloned_user.user_device());
|
trace!("[realtime]: send {} => {}", message, cloned_user.user_device());
|
||||||
if let Err(err) = sink.send(message).await {
|
if let Err(err) = sink.send(message).await {
|
||||||
error!("fail to broadcast message:{}", err);
|
warn!("fail to broadcast message:{}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(_) => {
|
||||||
error!("fail to receive message:{}", e);
|
// Err(RecvError::Closed) is returned when all Sender halves have dropped,
|
||||||
|
// indicating that no further values can be sent on the channel.
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ impl CollabGroup {
|
||||||
));
|
));
|
||||||
let broadcast = {
|
let broadcast = {
|
||||||
let lock = collab.read().await;
|
let lock = collab.read().await;
|
||||||
CollabBroadcast::new(&object_id, 10, edit_state.clone(), &lock)
|
CollabBroadcast::new(&object_id, 1000, edit_state.clone(), &lock)
|
||||||
};
|
};
|
||||||
let (destroy_group_tx, rx) = mpsc::channel(1);
|
let (destroy_group_tx, rx) = mpsc::channel(1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,15 @@ pub async fn get_access_request(
|
||||||
) -> Result<AccessRequest, AppError> {
|
) -> Result<AccessRequest, AppError> {
|
||||||
let access_request_with_view_id =
|
let access_request_with_view_id =
|
||||||
select_access_request_by_request_id(pg_pool, access_request_id).await?;
|
select_access_request_by_request_id(pg_pool, access_request_id).await?;
|
||||||
|
|
||||||
if access_request_with_view_id.workspace.owner_uid != user_uid {
|
if access_request_with_view_id.workspace.owner_uid != user_uid {
|
||||||
return Err(AppError::NotEnoughPermissions);
|
return Err(AppError::NotEnoughPermissions {
|
||||||
|
user: user_uid.to_string(),
|
||||||
|
workspace_id: access_request_with_view_id
|
||||||
|
.workspace
|
||||||
|
.workspace_id
|
||||||
|
.to_string(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
let folder = get_latest_collab_folder(
|
let folder = get_latest_collab_folder(
|
||||||
collab_storage,
|
collab_storage,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue