diff --git a/libs/database/src/collab/collab_storage.rs b/libs/database/src/collab/collab_storage.rs index 1455d6be..e3980156 100644 --- a/libs/database/src/collab/collab_storage.rs +++ b/libs/database/src/collab/collab_storage.rs @@ -89,7 +89,7 @@ pub trait CollabStorage: Send + Sync + 'static { /// # Returns /// /// * `Result` - Returns the data of the collaboration if found, `Err` otherwise. - async fn get_collab_encoded_v1( + async fn get_collab_encoded( &self, uid: &i64, params: QueryCollabParams, @@ -150,7 +150,7 @@ where self.as_ref().insert_collab(uid, params).await } - async fn get_collab_encoded_v1( + async fn get_collab_encoded( &self, uid: &i64, params: QueryCollabParams, @@ -158,7 +158,7 @@ where ) -> DatabaseResult { self .as_ref() - .get_collab_encoded_v1(uid, params, force_from_disk) + .get_collab_encoded(uid, params, force_from_disk) .await } @@ -255,7 +255,7 @@ impl CollabStorage for CollabStoragePgImpl { Ok(()) } - async fn get_collab_encoded_v1( + async fn get_collab_encoded( &self, _uid: &i64, params: QueryCollabParams, @@ -268,9 +268,8 @@ impl CollabStorage for CollabStoragePgImpl { ) .await { - Ok(data) => EncodedCollab::decode_from_bytes(&data).map_err(|err| { - AppError::Internal(anyhow!("fail to decode data to EncodedDocV1: {:?}", err)) - }), + Ok(data) => EncodedCollab::decode_from_bytes(&data) + .map_err(|err| AppError::Internal(anyhow!("fail to decode data to EncodedDoc: {:?}", err))), Err(e) => match e { sqlx::Error::RowNotFound => { let msg = format!("Can't find the row for query: {:?}", params); diff --git a/libs/realtime/src/collaborate/plugin.rs b/libs/realtime/src/collaborate/plugin.rs index 83872675..1c0b876a 100644 --- a/libs/realtime/src/collaborate/plugin.rs +++ b/libs/realtime/src/collaborate/plugin.rs @@ -175,7 +175,7 @@ where match self .storage - .get_collab_encoded_v1(&self.uid, params, true) + .get_collab_encoded(&self.uid, params, true) .await { Ok(encoded_collab_v1) => match init_collab_with_raw_data(object_id, &encoded_collab_v1, doc) diff --git a/src/api/workspace.rs b/src/api/workspace.rs index 62bc6aea..cf8af79c 100644 --- a/src/api/workspace.rs +++ b/src/api/workspace.rs @@ -291,7 +291,7 @@ async fn get_collab_handler( .map_err(AppResponseError::from)?; let data = state .collab_storage - .get_collab_encoded_v1(&uid, payload.into_inner(), false) + .get_collab_encoded(&uid, payload.into_inner(), false) .await .map_err(AppResponseError::from)?; @@ -326,7 +326,7 @@ async fn create_collab_snapshot_handler( .map_err(AppResponseError::from)?; let encoded_collab_v1 = state .collab_storage - .get_collab_encoded_v1( + .get_collab_encoded( &uid, QueryCollabParams::new(&object_id, collab_type, &workspace_id), false, diff --git a/src/biz/collab/storage.rs b/src/biz/collab/storage.rs index 37873392..d44c2b74 100644 --- a/src/biz/collab/storage.rs +++ b/src/biz/collab/storage.rs @@ -142,7 +142,7 @@ where self.inner.insert_collab(uid, params).await } - async fn get_collab_encoded_v1( + async fn get_collab_encoded( &self, uid: &i64, params: QueryCollabParams, @@ -172,7 +172,7 @@ where "Get collab data:{} from disk", params.object_id ); - self.inner.get_collab_encoded_v1(uid, params, true).await + self.inner.get_collab_encoded(uid, params, true).await }, Some(collab) => { event!(