chore: start init sync when open document/database (#5040)

This commit is contained in:
Nathan.fooo 2024-04-02 22:15:42 +08:00 committed by GitHub
parent 419600ca11
commit dff3ea60bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 258 additions and 88 deletions

View File

@ -3,7 +3,6 @@ import 'dart:async';
import 'package:appflowy/plugins/document/application/doc_sync_state_listener.dart'; import 'package:appflowy/plugins/document/application/doc_sync_state_listener.dart';
import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/auth/auth_service.dart'; import 'package:appflowy/user/application/auth/auth_service.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-document/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-document/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
@ -37,9 +36,6 @@ class DocumentSyncBloc extends Bloc<DocumentSyncEvent, DocumentSyncBlocState> {
); );
_syncStateListener.start( _syncStateListener.start(
didReceiveSyncState: (syncState) { didReceiveSyncState: (syncState) {
Log.info(
'document sync state changed, from ${state.syncState} to $syncState',
);
add(DocumentSyncEvent.syncStateChanged(syncState)); add(DocumentSyncEvent.syncStateChanged(syncState));
}, },
); );

View File

@ -156,7 +156,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -167,8 +167,10 @@ dependencies = [
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"tokio", "tokio",
"tsify",
"url", "url",
"uuid", "uuid",
"wasm-bindgen",
] ]
[[package]] [[package]]
@ -710,7 +712,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -758,7 +760,7 @@ dependencies = [
[[package]] [[package]]
name = "client-websocket" name = "client-websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -832,7 +834,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -856,7 +858,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -886,7 +888,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -905,7 +907,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -920,7 +922,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -958,7 +960,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -997,7 +999,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-entity" name = "collab-rt-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -1022,7 +1024,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-protocol" name = "collab-rt-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -1036,7 +1038,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1370,7 +1372,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2657,6 +2659,19 @@ dependencies = [
"walkdir", "walkdir",
] ]
[[package]]
name = "gloo-utils"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e"
dependencies = [
"js-sys",
"serde",
"serde_json",
"wasm-bindgen",
"web-sys",
]
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.15.10" version = "0.15.10"
@ -2671,7 +2686,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2688,7 +2703,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -3139,7 +3154,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -5420,6 +5435,17 @@ dependencies = [
"syn 2.0.47", "syn 2.0.47",
] ]
[[package]]
name = "serde_derive_internals"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.47",
]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.111" version = "1.0.111"
@ -5572,7 +5598,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -6628,6 +6654,31 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "tsify"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0"
dependencies = [
"gloo-utils",
"serde",
"serde_json",
"tsify-macros",
"wasm-bindgen",
]
[[package]]
name = "tsify-macros"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a94b0f0954b3e59bfc2c246b4c8574390d94a4ad4ad246aaf2fb07d7dfd3b47"
dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.47",
]
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.20.1" version = "0.20.1"
@ -7535,7 +7586,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -87,7 +87,7 @@ yrs = { git = "https://github.com/appflowy/y-crdt", rev = "3f25bb510ca5274e7657d
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fbadca759a6e51c65b46f833d9323cc41c501517" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "63bea3c5b95a638c3eed151d4ff696af9cbc0375" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -97,10 +97,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fba
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }

View File

@ -215,7 +215,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -226,8 +226,10 @@ dependencies = [
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"tokio", "tokio",
"tsify",
"url", "url",
"uuid", "uuid",
"wasm-bindgen",
] ]
[[package]] [[package]]
@ -539,7 +541,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -586,7 +588,7 @@ dependencies = [
[[package]] [[package]]
name = "client-websocket" name = "client-websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -630,7 +632,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -654,7 +656,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -673,7 +675,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -688,7 +690,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -726,7 +728,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -764,7 +766,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-entity" name = "collab-rt-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -789,7 +791,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-protocol" name = "collab-rt-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -803,7 +805,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1000,7 +1002,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1752,10 +1754,23 @@ dependencies = [
"walkdir", "walkdir",
] ]
[[package]]
name = "gloo-utils"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e"
dependencies = [
"js-sys",
"serde",
"serde_json",
"wasm-bindgen",
"web-sys",
]
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -1772,7 +1787,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2102,7 +2117,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -3694,6 +3709,17 @@ dependencies = [
"syn 2.0.48", "syn 2.0.48",
] ]
[[package]]
name = "serde_derive_internals"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.111" version = "1.0.111"
@ -3777,7 +3803,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -4315,6 +4341,31 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "tsify"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0"
dependencies = [
"gloo-utils",
"serde",
"serde_json",
"tsify-macros",
"wasm-bindgen",
]
[[package]]
name = "tsify-macros"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a94b0f0954b3e59bfc2c246b4c8574390d94a4ad4ad246aaf2fb07d7dfd3b47"
dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.48",
]
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.20.1" version = "0.20.1"
@ -5009,4 +5060,4 @@ dependencies = [
[[patch.unused]] [[patch.unused]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"

View File

@ -55,7 +55,7 @@ codegen-units = 1
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fbadca759a6e51c65b46f833d9323cc41c501517" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "63bea3c5b95a638c3eed151d4ff696af9cbc0375" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -65,10 +65,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fba
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }

View File

@ -157,7 +157,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -168,8 +168,10 @@ dependencies = [
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"tokio", "tokio",
"tsify",
"url", "url",
"uuid", "uuid",
"wasm-bindgen",
] ]
[[package]] [[package]]
@ -667,7 +669,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -715,7 +717,7 @@ dependencies = [
[[package]] [[package]]
name = "client-websocket" name = "client-websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -758,7 +760,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -782,7 +784,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -812,7 +814,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -831,7 +833,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -846,7 +848,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -884,7 +886,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -923,7 +925,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-entity" name = "collab-rt-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -948,7 +950,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-rt-protocol" name = "collab-rt-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -962,7 +964,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0#6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1292,7 +1294,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2463,10 +2465,23 @@ dependencies = [
"walkdir", "walkdir",
] ]
[[package]]
name = "gloo-utils"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e"
dependencies = [
"js-sys",
"serde",
"serde_json",
"wasm-bindgen",
"web-sys",
]
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2483,7 +2498,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2873,7 +2888,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -4821,6 +4836,17 @@ dependencies = [
"syn 2.0.47", "syn 2.0.47",
] ]
[[package]]
name = "serde_derive_internals"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.47",
]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.111" version = "1.0.111"
@ -4926,7 +4952,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -5731,6 +5757,31 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "tsify"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0"
dependencies = [
"gloo-utils",
"serde",
"serde_json",
"tsify-macros",
"wasm-bindgen",
]
[[package]]
name = "tsify-macros"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a94b0f0954b3e59bfc2c246b4c8574390d94a4ad4ad246aaf2fb07d7dfd3b47"
dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.47",
]
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.20.1" version = "0.20.1"
@ -6339,7 +6390,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=fbadca759a6e51c65b46f833d9323cc41c501517#fbadca759a6e51c65b46f833d9323cc41c501517" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -111,7 +111,7 @@ rocksdb = { git = "https://github.com/LucasXu0/rust-rocksdb", rev = "21cf4a23ec1
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fbadca759a6e51c65b46f833d9323cc41c501517" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "63bea3c5b95a638c3eed151d4ff696af9cbc0375" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -121,10 +121,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "fba
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "6d42cd92bc5b8fe489230ea9d6e4ccc87892a8e0" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2" }

View File

@ -259,7 +259,6 @@ impl AppFlowyCollabBuilder {
local_collab, local_collab,
}); });
trace!("add appflowy cloud collab plugins: {}", plugins.len());
for plugin in plugins { for plugin in plugins {
arc_collab.lock().add_plugin(plugin); arc_collab.lock().add_plugin(plugin);
} }

View File

@ -30,8 +30,8 @@ lib-dispatch = { workspace = true }
# Core # Core
#flowy-core = { workspace = true, features = ["profiling"] } #flowy-core = { workspace = true, features = ["profiling"] }
flowy-core = { workspace = true, features = ["verbose_log"] } #flowy-core = { workspace = true, features = ["verbose_log"] }
#flowy-core = { workspace = true } flowy-core = { workspace = true }
flowy-notification = { workspace = true, features = ["dart"] } flowy-notification = { workspace = true, features = ["dart"] }
flowy-document = { workspace = true, features = ["dart"] } flowy-document = { workspace = true, features = ["dart"] }

View File

@ -211,6 +211,7 @@ impl DatabaseManager {
if let Some(editor) = self.editors.lock().await.get(database_id).cloned() { if let Some(editor) = self.editors.lock().await.get(database_id).cloned() {
return Ok(editor); return Ok(editor);
} }
// TODO(nathan): refactor the get_database that split the database creation and database opening.
self.open_database(database_id).await self.open_database(database_id).await
} }
@ -239,7 +240,14 @@ impl DatabaseManager {
let view_id = view_id.as_ref(); let view_id = view_id.as_ref();
let wdb = self.get_workspace_database().await?; let wdb = self.get_workspace_database().await?;
if let Some(database_id) = wdb.get_database_id_with_view_id(view_id) { if let Some(database_id) = wdb.get_database_id_with_view_id(view_id) {
wdb.open_database(&database_id); if let Some(database) = wdb.open_database(&database_id) {
if let Some(lock_database) = database.try_lock() {
if let Some(lock_collab) = lock_database.get_collab().try_lock() {
trace!("{} database start init sync", view_id);
lock_collab.start_init_sync();
}
}
}
} }
Ok(()) Ok(())
} }

View File

@ -12,7 +12,7 @@ use std::{
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
sync::Arc, sync::Arc,
}; };
use tracing::trace; use tracing::{instrument, trace, warn};
/// This struct wrap the document::Document /// This struct wrap the document::Document
#[derive(Clone)] #[derive(Clone)]
@ -47,6 +47,19 @@ impl MutexDocument {
Document::create_with_data(collab, data).map(|inner| Self(Arc::new(Mutex::new(inner))))?; Document::create_with_data(collab, data).map(|inner| Self(Arc::new(Mutex::new(inner))))?;
Ok(document) Ok(document)
} }
#[instrument(level = "debug", skip_all)]
pub fn start_init_sync(&self) {
if let Some(document) = self.0.try_lock() {
if let Some(collab) = document.get_collab().try_lock() {
collab.start_init_sync();
} else {
warn!("Failed to start init sync, collab is locked");
}
} else {
warn!("Failed to start init sync, document is locked");
}
}
} }
fn subscribe_document_changed(doc_id: &str, document: &MutexDocument) { fn subscribe_document_changed(doc_id: &str, document: &MutexDocument) {

View File

@ -207,8 +207,9 @@ impl DocumentManager {
} }
pub async fn open_document(&self, doc_id: &str) -> FlowyResult<()> { pub async fn open_document(&self, doc_id: &str) -> FlowyResult<()> {
// TODO(nathan): refactor the get_database that split the database creation and database opening. if let Some(mutex_document) = self.restore_document_from_removing(doc_id) {
self.restore_document_from_removing(doc_id); mutex_document.start_init_sync();
}
Ok(()) Ok(())
} }