diff --git a/libs/client-api-test/src/test_client.rs b/libs/client-api-test/src/test_client.rs index 4f01c3ae..e7ba7a22 100644 --- a/libs/client-api-test/src/test_client.rs +++ b/libs/client-api-test/src/test_client.rs @@ -1,4 +1,3 @@ -use crate::{load_env, localhost_client_with_device_id, setup_log}; use std::collections::HashMap; use std::ops::Deref; use std::path::{Path, PathBuf}; @@ -42,7 +41,7 @@ use shared_entity::dto::workspace_dto::{ use shared_entity::response::AppResponseError; use crate::user::{generate_unique_registered_user, User}; -use crate::{localhost_client_with_device_id, setup_log}; +use crate::{load_env, localhost_client_with_device_id, setup_log}; pub struct TestClient { pub user: User, diff --git a/libs/collab-rt-entity/src/realtime_proto.rs b/libs/collab-rt-entity/src/realtime_proto.rs index e07a9281..93c26841 100644 --- a/libs/collab-rt-entity/src/realtime_proto.rs +++ b/libs/collab-rt-entity/src/realtime_proto.rs @@ -2,8 +2,8 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRealtimeMessage { - #[prost(string, tag = "1")] - pub device_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub payload: ::prost::alloc::vec::Vec, + #[prost(string, tag = "1")] + pub device_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub payload: ::prost::alloc::vec::Vec, } diff --git a/libs/collab-rt-protocol/src/message.rs b/libs/collab-rt-protocol/src/message.rs index 340b37b7..1b67946f 100644 --- a/libs/collab-rt-protocol/src/message.rs +++ b/libs/collab-rt-protocol/src/message.rs @@ -1,9 +1,8 @@ -use collab::core::awareness::AwarenessUpdate; -use serde::{Deserialize, Serialize}; use std::fmt::{Debug, Display, Formatter}; +use collab::core::awareness::AwarenessUpdate; +use serde::{Deserialize, Serialize}; use thiserror::Error; - use yrs::updates::decoder::{Decode, Decoder}; use yrs::updates::encoder::{Encode, Encoder}; use yrs::StateVector; @@ -45,7 +44,7 @@ impl Encode for Message { }, Message::Awareness(update) => { encoder.write_var(MSG_AWARENESS); - encoder.write_buf(&update.encode_v1()) + encoder.write_buf(update.encode_v1()) }, Message::Custom(msg) => { encoder.write_var(MSG_CUSTOM); diff --git a/libs/collab-stream/src/stream_group.rs b/libs/collab-stream/src/stream_group.rs index c3b0de59..55fe754e 100644 --- a/libs/collab-stream/src/stream_group.rs +++ b/libs/collab-stream/src/stream_group.rs @@ -1,5 +1,6 @@ -use crate::error::StreamError; -use crate::model::{MessageId, StreamBinary, StreamMessage, StreamMessageByStreamKey}; +use std::sync::Arc; +use std::time::Duration; + use chrono::{DateTime, Utc}; use redis::aio::ConnectionManager; use redis::streams::{ @@ -7,12 +8,12 @@ use redis::streams::{ StreamReadOptions, }; use redis::{pipe, AsyncCommands, ErrorKind, RedisResult}; -use std::sync::Arc; -use std::time::Duration; use tokio_util::sync::CancellationToken; - use tracing::{error, info, trace, warn}; +use crate::error::StreamError; +use crate::model::{MessageId, StreamBinary, StreamMessage, StreamMessageByStreamKey}; + #[derive(Clone)] pub struct StreamGroup { connection_manager: ConnectionManager, @@ -219,14 +220,14 @@ impl StreamGroup { /// Returns the messages that were not consumed yet. Which means each message is delivered to only /// one consumer in the group /// - /// $: This symbol is used with the XREAD command to indicate that you want to start reading only + /// `$`: This symbol is used with the XREAD command to indicate that you want to start reading only /// new messages that arrive in the stream after the read command has been issued. Essentially, /// it tells Redis to ignore all the messages already in the stream and only listen for new ones. /// It's particularly useful when you want to start processing messages from the current moment /// forward and don't need to process historical messages. /// - /// >: This symbol is used with the XREADGROUP command in the context of consumer groups. When a - /// consumer group reads from a stream using >, it tells Redis to deliver only messages that have + /// `>`: This symbol is used with the XREADGROUP command in the context of consumer groups. When a + /// consumer group reads from a stream using `>`, it tells Redis to deliver only messages that have /// not yet been acknowledged by any consumer in the group. This allows different consumers in the /// group to read and process different messages concurrently, without receiving messages that have /// already been processed by another consumer. It's a way to distribute the workload of processing diff --git a/services/appflowy-collaborate/src/collab/mem_cache.rs b/services/appflowy-collaborate/src/collab/mem_cache.rs index 33c2eda1..26b0f698 100644 --- a/services/appflowy-collaborate/src/collab/mem_cache.rs +++ b/services/appflowy-collaborate/src/collab/mem_cache.rs @@ -242,6 +242,7 @@ impl CollabMemCache { /// A `RedisResult)>>` where: /// - `i64` is the timestamp of the data. /// - `Vec` is the binary data. + /// /// The function returns `Ok(None)` if no data is found for the given `object_id`. async fn get_data_with_timestamp( &self, diff --git a/services/appflowy-collaborate/src/group/group_init.rs b/services/appflowy-collaborate/src/group/group_init.rs index 70b1bdf7..68240c4b 100644 --- a/services/appflowy-collaborate/src/group/group_init.rs +++ b/services/appflowy-collaborate/src/group/group_init.rs @@ -10,7 +10,7 @@ use collab_entity::CollabType; use dashmap::DashMap; use futures_util::{SinkExt, StreamExt}; use tokio::sync::{mpsc, RwLock}; -use tracing::{debug, error, event, trace}; +use tracing::{error, event, info, trace}; use yrs::updates::decoder::Decode; use yrs::updates::encoder::Encode; use yrs::Update; diff --git a/services/appflowy-collaborate/src/indexer/document_indexer.rs b/services/appflowy-collaborate/src/indexer/document_indexer.rs index e148f504..c83a7a2e 100644 --- a/services/appflowy-collaborate/src/indexer/document_indexer.rs +++ b/services/appflowy-collaborate/src/indexer/document_indexer.rs @@ -7,7 +7,6 @@ use collab::preclude::Collab; use collab_document::document::Document; use collab_document::error::DocumentError; use collab_entity::CollabType; -use std::sync::Arc; use app_error::AppError; use appflowy_ai_client::client::AppFlowyAIClient;