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