From 84d171b1db8bd6b9d83878a82bf60b0c80f7a7e0 Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Tue, 23 Jan 2024 01:33:52 +0800 Subject: [PATCH] chore: bump client api to fix user session issue (#4445) --- frontend/appflowy_tauri/src-tauri/Cargo.lock | 23 +++++------ frontend/appflowy_tauri/src-tauri/Cargo.toml | 2 +- frontend/rust-lib/Cargo.lock | 39 +++++++++++++------ frontend/rust-lib/Cargo.toml | 2 +- .../flowy-server/src/af_cloud/server.rs | 4 +- 5 files changed, 43 insertions(+), 27 deletions(-) diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index c08bdc42fd..293332ea12 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.lock +++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock @@ -151,7 +151,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -699,7 +699,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -707,6 +707,7 @@ dependencies = [ "bincode", "brotli", "bytes", + "chrono", "collab", "collab-entity", "database-entity", @@ -1176,7 +1177,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.6", - "phf 0.11.2", + "phf 0.8.0", "smallvec", ] @@ -1287,7 +1288,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -2548,7 +2549,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "futures-util", @@ -2565,7 +2566,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -3001,7 +3002,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "reqwest", @@ -4653,7 +4654,7 @@ dependencies = [ [[package]] name = "realtime-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -4675,7 +4676,7 @@ dependencies = [ [[package]] name = "realtime-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -5323,7 +5324,7 @@ dependencies = [ [[package]] name = "shared_entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -7171,7 +7172,7 @@ dependencies = [ [[package]] name = "workspace-template" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "async-trait", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index d4c9163b6f..850b0fa8c7 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -58,7 +58,7 @@ custom-protocol = ["tauri/custom-protocol"] # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "480b7377f28c01c92c90eda648f67aae5bad8931" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ee3abdb27a2d056e7399b486354d26e802720c00" } # Please use the following script to update collab. # Working directory: frontend # diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index ed89dc3edd..88c9e12342 100644 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -152,7 +152,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -662,7 +662,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -670,6 +670,7 @@ dependencies = [ "bincode", "brotli", "bytes", + "chrono", "collab", "collab-entity", "database-entity", @@ -1084,7 +1085,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.8.0", + "phf 0.11.2", "smallvec", ] @@ -1213,7 +1214,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -2380,7 +2381,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "futures-util", @@ -2397,7 +2398,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -2772,7 +2773,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "reqwest", @@ -3536,7 +3537,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ - "phf_macros", + "phf_macros 0.8.0", "phf_shared 0.8.0", "proc-macro-hack", ] @@ -3556,6 +3557,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ + "phf_macros 0.11.2", "phf_shared 0.11.2", ] @@ -3623,6 +3625,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.47", +] + [[package]] name = "phf_shared" version = "0.8.0" @@ -4176,7 +4191,7 @@ dependencies = [ [[package]] name = "realtime-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -4198,7 +4213,7 @@ dependencies = [ [[package]] name = "realtime-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "bincode", @@ -4777,7 +4792,7 @@ dependencies = [ [[package]] name = "shared_entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "app-error", @@ -6084,7 +6099,7 @@ dependencies = [ [[package]] name = "workspace-template" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=480b7377f28c01c92c90eda648f67aae5bad8931#480b7377f28c01c92c90eda648f67aae5bad8931" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ee3abdb27a2d056e7399b486354d26e802720c00#ee3abdb27a2d056e7399b486354d26e802720c00" dependencies = [ "anyhow", "async-trait", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 83226df02d..d9ce2ce106 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -105,7 +105,7 @@ incremental = false # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "480b7377f28c01c92c90eda648f67aae5bad8931" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ee3abdb27a2d056e7399b486354d26e802720c00" } # Please use the following script to update collab. # Working directory: frontend # diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs b/frontend/rust-lib/flowy-server/src/af_cloud/server.rs index f7eeaa8789..13a4856623 100644 --- a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs +++ b/frontend/rust-lib/flowy-server/src/af_cloud/server.rs @@ -247,7 +247,7 @@ fn spawn_ws_conn( // Try to reconnect if the connection is timed out. if let Some(api_client) = weak_api_client.upgrade() { if enable_sync.load(Ordering::SeqCst) { - match api_client.ws_url(&cloned_device_id) { + match api_client.ws_url(&cloned_device_id).await { Ok(ws_addr) => { event!(tracing::Level::INFO, "🟢reconnecting websocket"); let _ = ws_client.connect(ws_addr, &cloned_device_id).await; @@ -280,7 +280,7 @@ fn spawn_ws_conn( if let (Some(api_client), Some(ws_client)) = (weak_api_client.upgrade(), weak_ws_client.upgrade()) { - match api_client.ws_url(&device_id) { + match api_client.ws_url(&device_id).await { Ok(ws_addr) => { info!("🟢token state: {:?}, reconnecting websocket", token_state); let _ = ws_client.connect(ws_addr, &device_id).await;