diff --git a/.github/workflows/rustlint.yml b/.github/workflows/rustlint.yml index 7270844b..cf7dd7b1 100644 --- a/.github/workflows/rustlint.yml +++ b/.github/workflows/rustlint.yml @@ -11,7 +11,7 @@ env: SQLX_VERSION: 0.7.1 SQLX_FEATURES: "rustls,postgres" SQLX_OFFLINE: true - RUST_TOOLCHAIN: "1.75" + RUST_TOOLCHAIN: "1.77" jobs: test: diff --git a/.github/workflows/wasm_ci.yml b/.github/workflows/wasm_ci.yml index 96a0c0ae..75cbfc2b 100644 --- a/.github/workflows/wasm_ci.yml +++ b/.github/workflows/wasm_ci.yml @@ -9,7 +9,7 @@ on: env: NODE_VERSION: '20.12.0' - RUST_TOOLCHAIN: "1.75" + RUST_TOOLCHAIN: "1.77" jobs: build: diff --git a/.github/workflows/wasm_publish.yml b/.github/workflows/wasm_publish.yml index 3ef6a56f..3a12decd 100644 --- a/.github/workflows/wasm_publish.yml +++ b/.github/workflows/wasm_publish.yml @@ -30,7 +30,7 @@ on: env: NODE_VERSION: '20.12.0' - RUST_TOOLCHAIN: "1.75" + RUST_TOOLCHAIN: "1.77" jobs: publish: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index cc57b616..2e7dcf7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Using cargo-chef to manage Rust build cache effectively -FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef WORKDIR /app RUN apt update && apt install lld clang -y diff --git a/admin_frontend/Dockerfile b/admin_frontend/Dockerfile index c66ac77a..f0009d6a 100644 --- a/admin_frontend/Dockerfile +++ b/admin_frontend/Dockerfile @@ -1,6 +1,6 @@ # User should build from parent directory -FROM lukemathwalker/cargo-chef:latest-rust-1.75 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef WORKDIR /app RUN apt update && apt install lld clang -y diff --git a/libs/client-api-test-util/src/test_client.rs b/libs/client-api-test-util/src/test_client.rs index dcafe7d1..19a36760 100644 --- a/libs/client-api-test-util/src/test_client.rs +++ b/libs/client-api-test-util/src/test_client.rs @@ -428,6 +428,7 @@ impl TestClient { timeout_secs: u64, ) -> Result { let duration = Duration::from_secs(timeout_secs); + #[allow(clippy::blocks_in_conditions)] match timeout(duration, async { let mut snapshot_metas = self.get_snapshot_list(workspace_id, object_id).await?; // Loop until the condition `f` returns true or the timeout is reached diff --git a/libs/client-api/src/native/http_native.rs b/libs/client-api/src/native/http_native.rs index f048900a..551e99a5 100644 --- a/libs/client-api/src/native/http_native.rs +++ b/libs/client-api/src/native/http_native.rs @@ -18,7 +18,7 @@ use std::sync::atomic::Ordering; use std::time::Duration; use tokio_retry::strategy::{ExponentialBackoff, FixedInterval}; use tokio_retry::{Retry, RetryIf}; -use tracing::{event, instrument}; +use tracing::{event, info, instrument}; impl Client { #[instrument(level = "debug", skip_all)] @@ -26,6 +26,7 @@ impl Client { &self, params: QueryCollabParams, ) -> Result { + info!("get collab:{}", params); // 2 seconds, 4 seconds, 8 seconds let retry_strategy = ExponentialBackoff::from_millis(2).factor(1000).take(3); let action = GetCollabAction::new(self.clone(), params); diff --git a/libs/collab-stream/src/model.rs b/libs/collab-stream/src/model.rs index 96517abe..f2f981cb 100644 --- a/libs/collab-stream/src/model.rs +++ b/libs/collab-stream/src/model.rs @@ -246,33 +246,6 @@ fn bulk_from_redis_value(v: &Value) -> Result<&Vec, RedisError> { } } -struct UserId(i64); - -impl FromRedisValue for UserId { - fn from_redis_value(v: &Value) -> RedisResult { - match v { - Value::Data(uid_bytes) => { - if uid_bytes.len() == std::mem::size_of::() { - let mut buf = [0u8; 8]; - buf.copy_from_slice(uid_bytes); - let value = i64::from_be_bytes(buf); - Ok(Self(value)) - } else { - Err(RedisError::from(( - redis::ErrorKind::TypeError, - "Invalid UID length", - format!("Expected 8 bytes, got {}", uid_bytes.len()), - ))) - } - }, - _ => Err(RedisError::from(( - redis::ErrorKind::TypeError, - "Expected Value::Data for UID", - ))), - } - } -} - #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub enum CollabControlEvent { Open { diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs index b6a0ef7d..9a693bb8 100644 --- a/libs/database-entity/src/dto.rs +++ b/libs/database-entity/src/dto.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; use std::cmp::Ordering; use std::collections::HashMap; +use std::fmt::Display; use std::ops::{Deref, DerefMut}; use std::str::FromStr; use tracing::error; @@ -159,6 +160,16 @@ pub struct QueryCollabParams { pub inner: QueryCollab, } +impl Display for QueryCollabParams { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "workspace_id: {}, object_id: {}, collab_type: {:?}", + self.workspace_id, self.object_id, self.collab_type + ) + } +} + impl QueryCollabParams { pub fn new( object_id: T1, diff --git a/services/appflowy-history/Dockerfile b/services/appflowy-history/Dockerfile index 24206e2a..d2bc80d1 100644 --- a/services/appflowy-history/Dockerfile +++ b/services/appflowy-history/Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef # Set the initial working directory WORKDIR /app diff --git a/src/biz/collab/storage.rs b/src/biz/collab/storage.rs index 7bc44a04..13feaea8 100644 --- a/src/biz/collab/storage.rs +++ b/src/biz/collab/storage.rs @@ -245,6 +245,7 @@ where } #[instrument(level = "trace", skip(self, params), oid = %params.oid, ty = %params.collab_type, err)] + #[allow(clippy::blocks_in_conditions)] async fn insert_new_collab_with_transaction( &self, workspace_id: &str,