chore: bump collab (#5042)

* chore: bump collab

* chore: bump client api

* chore: fix test
This commit is contained in:
Nathan.fooo 2024-04-03 11:26:48 +08:00 committed by GitHub
parent e022ee88da
commit a25c728866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 174 additions and 120 deletions

View File

@ -156,7 +156,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -712,7 +712,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"again",
"anyhow",
@ -735,7 +735,6 @@ dependencies = [
"gotrue-entity",
"governor",
"mime",
"mime_guess",
"parking_lot 0.12.1",
"prost",
"reqwest",
@ -760,7 +759,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"futures-channel",
"futures-util",
@ -834,7 +833,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-trait",
@ -858,7 +857,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-trait",
@ -888,7 +887,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -907,7 +906,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"bytes",
@ -922,7 +921,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"chrono",
@ -960,7 +959,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-stream",
@ -999,7 +998,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -1024,7 +1023,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -1038,7 +1037,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -1261,7 +1260,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa 1.0.6",
"phf 0.11.2",
"phf 0.8.0",
"smallvec",
]
@ -1372,7 +1371,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -2686,7 +2685,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"futures-util",
@ -2703,7 +2702,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -3154,7 +3153,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"reqwest",
@ -5598,7 +5597,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -7586,7 +7585,7 @@ dependencies = [
[[package]]
name = "workspace-template"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"async-trait",

View File

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

View File

@ -215,7 +215,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -541,7 +541,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"again",
"anyhow",
@ -564,7 +564,6 @@ dependencies = [
"gotrue-entity",
"governor",
"mime",
"mime_guess",
"parking_lot 0.12.1",
"prost",
"reqwest",
@ -588,7 +587,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"futures-channel",
"futures-util",
@ -632,7 +631,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-trait",
@ -656,7 +655,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -675,7 +674,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"bytes",
@ -690,7 +689,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"chrono",
@ -728,7 +727,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-stream",
@ -766,7 +765,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -791,7 +790,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -805,7 +804,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -957,7 +956,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa",
"phf 0.8.0",
"phf 0.11.2",
"smallvec",
]
@ -1002,7 +1001,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -1770,7 +1769,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"futures-util",
@ -1787,7 +1786,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -2117,7 +2116,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"reqwest",
@ -2837,7 +2836,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",
]
@ -2857,6 +2856,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",
]
@ -2924,6 +2924,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.48",
]
[[package]]
name = "phf_shared"
version = "0.8.0"
@ -3803,7 +3816,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -5060,4 +5073,4 @@ dependencies = [
[[patch.unused]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"

View File

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

View File

@ -157,7 +157,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -669,7 +669,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"again",
"anyhow",
@ -692,7 +692,6 @@ dependencies = [
"gotrue-entity",
"governor",
"mime",
"mime_guess",
"parking_lot 0.12.1",
"prost",
"reqwest",
@ -717,7 +716,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"futures-channel",
"futures-util",
@ -760,7 +759,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-trait",
@ -784,7 +783,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-trait",
@ -814,7 +813,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -833,7 +832,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"bytes",
@ -848,7 +847,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"chrono",
@ -886,7 +885,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"async-stream",
@ -925,7 +924,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -950,7 +949,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"bincode",
@ -964,7 +963,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2#9e519d46bb8c4c5097d8c9dbc8f77707f8041ee2"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=a7a990dfc62a766829d28d2a9bb383840d8146f4#a7a990dfc62a766829d28d2a9bb383840d8146f4"
dependencies = [
"anyhow",
"collab",
@ -1161,7 +1160,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa",
"phf 0.8.0",
"phf 0.11.2",
"smallvec",
]
@ -1294,7 +1293,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -2481,7 +2480,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"futures-util",
@ -2498,7 +2497,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -2888,7 +2887,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"reqwest",
@ -3698,7 +3697,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",
]
@ -3718,6 +3717,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",
]
@ -3785,6 +3785,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"
@ -4952,7 +4965,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"app-error",
@ -6390,7 +6403,7 @@ dependencies = [
[[package]]
name = "workspace-template"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=63bea3c5b95a638c3eed151d4ff696af9cbc0375#63bea3c5b95a638c3eed151d4ff696af9cbc0375"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c77329ea11cc519b3158c7edf983b45b572dc360#c77329ea11cc519b3158c7edf983b45b572dc360"
dependencies = [
"anyhow",
"async-trait",

View File

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

View File

@ -46,7 +46,7 @@ impl DocumentEventTest {
.await
.unwrap();
let guard = doc.lock();
guard.get_collab().encode_collab_v1()
guard.encode_collab().unwrap()
}
pub async fn create_document(&self) -> ViewPB {

View File

@ -445,8 +445,9 @@ async fn doc_state_from_document_data(
vec![],
false,
)));
let _ = Document::create_with_data(collab.clone(), data).map_err(internal_error)?;
Ok::<_, FlowyError>(collab.encode_collab_v1())
let document = Document::create_with_data(collab.clone(), data).map_err(internal_error)?;
let encode_collab = document.encode_collab()?;
Ok::<_, FlowyError>(encode_collab)
})
.await??;
Ok(encoded_collab)

View File

@ -25,21 +25,30 @@ impl DatabaseCloudService for LocalServerDatabaseCloudServiceImpl {
collab.with_origin_transact_mut(|txn| {
collab.insert_map_with_txn(txn, DATABASE);
});
collab.encode_collab_v1().doc_state.to_vec()
collab
.encode_collab_v1(|_| Ok::<(), Error>(()))?
.doc_state
.to_vec()
},
CollabType::WorkspaceDatabase => {
let collab = Collab::new(1, object_id, collab_type, vec![], false);
collab.with_origin_transact_mut(|txn| {
collab.create_array_with_txn::<MapPrelim<Any>>(txn, WORKSPACE_DATABASES, vec![]);
});
collab.encode_collab_v1().doc_state.to_vec()
collab
.encode_collab_v1(|_| Ok::<(), Error>(()))?
.doc_state
.to_vec()
},
CollabType::DatabaseRow => {
let collab = Collab::new(1, object_id, collab_type, vec![], false);
collab.with_origin_transact_mut(|txn| {
collab.insert_map_with_txn(txn, DATABASE_ROW_DATA);
});
collab.encode_collab_v1().doc_state.to_vec()
collab
.encode_collab_v1(|_| Ok::<(), Error>(()))?
.doc_state
.to_vec()
},
_ => vec![],
};

View File

@ -678,7 +678,7 @@ fn default_workspace_doc_state(collab_object: &CollabObject) -> Vec<u8> {
));
let workspace = Workspace::new(workspace_id, "My workspace".to_string(), collab_object.uid);
let folder = Folder::create(collab_object.uid, collab, None, FolderData::new(workspace));
folder.encode_collab_v1().doc_state.to_vec()
folder.encode_collab_v1().unwrap().doc_state.to_vec()
}
fn oauth_params_from_box_any(any: BoxAny) -> Result<SupabaseOAuthParams, Error> {

View File

@ -213,7 +213,9 @@ fn get_collab_doc_state(
.read_txn()
.load_doc_with_txn(uid, &collab_object.object_id, txn)
})?;
let doc_state = collab.encode_collab_v1().doc_state;
let doc_state = collab
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))?
.doc_state;
if doc_state.is_empty() {
return Err(PersistenceError::UnexpectedEmptyUpdates);
}
@ -234,7 +236,9 @@ fn get_database_doc_state(
})?;
let row_ids = get_database_row_ids(&collab).unwrap_or_default();
let doc_state = collab.encode_collab_v1().doc_state;
let doc_state = collab
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))?
.doc_state;
if doc_state.is_empty() {
return Err(PersistenceError::UnexpectedEmptyUpdates);
}
@ -257,7 +261,9 @@ async fn sync_folder(
.read_txn()
.load_doc_with_txn(uid, workspace_id, txn)
})?;
let doc_state = collab.encode_collab_v1().doc_state;
let doc_state = collab
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))?
.doc_state;
(
MutexFolder::new(Folder::open(
uid,
@ -318,7 +324,10 @@ async fn sync_database_views(
.map(|_| {
(
get_all_database_meta(&collab),
collab.encode_collab_v1().doc_state,
collab
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))
.unwrap()
.doc_state,
)
})
};

View File

@ -82,7 +82,9 @@ where
if load_collab(user_id, write_txn, &view.id).is_err() {
let collab = Arc::new(MutexCollab::new(origin.clone(), &view.id, vec![], false));
let document = Document::create_with_data(collab, default_document_data())?;
let encode = document.get_collab().encode_collab_v1();
let encode = document
.get_collab()
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))?;
write_txn.flush_doc_with(user_id, &view.id, &encode.doc_state, &encode.state_vector)?;
event!(
tracing::Level::INFO,

View File

@ -45,7 +45,9 @@ impl UserDataMigration for FavoriteV1AndWorkspaceArrayMigration {
folder.add_favorite_view_ids(favorite_view_ids);
}
let encode = folder.encode_collab_v1();
let encode = folder
.encode_collab_v1()
.map_err(|err| PersistenceError::Internal(err.into()))?;
write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,

View File

@ -41,7 +41,9 @@ impl UserDataMigration for WorkspaceTrashMapToSectionMigration {
folder.add_trash_view_ids(trash_ids);
}
let encode = folder.encode_collab_v1();
let encode = folder
.encode_collab_v1()
.map_err(|err| PersistenceError::Internal(err.into()))?;
write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,

View File

@ -213,6 +213,7 @@ pub(crate) fn import_appflowy_data_folder(
// create the content for the container view
let import_container_doc_state = default_document_collab_data(&import_container_view_id)
.map_err(|err| PersistenceError::InvalidData(err.to_string()))?
.doc_state
.to_vec();
import_collab_object_with_doc_state(
@ -419,27 +420,29 @@ where
W: CollabKVAction<'a>,
PersistenceError: From<W::Error>,
{
if let Ok(update) = Update::decode_v1(&collab.encode_collab_v1().doc_state) {
let doc = Doc::new();
{
let mut txn = doc.transact_mut();
txn.apply_update(update);
drop(txn);
}
if let Ok(encode_collab) = collab.encode_collab_v1(|_| Ok::<(), PersistenceError>(())) {
if let Ok(update) = Update::decode_v1(&encode_collab.doc_state) {
let doc = Doc::new();
{
let mut txn = doc.transact_mut();
txn.apply_update(update);
drop(txn);
}
let encoded_collab = doc.get_encoded_collab_v1();
info!(
"import collab:{} with len: {}",
new_object_id,
encoded_collab.doc_state.len()
);
if let Err(err) = w_txn.flush_doc(
new_uid,
&new_object_id,
encoded_collab.state_vector.to_vec(),
encoded_collab.doc_state.to_vec(),
) {
error!("import collab:{} failed: {:?}", new_object_id, err);
let encoded_collab = doc.get_encoded_collab_v1();
info!(
"import collab:{} with len: {}",
new_object_id,
encoded_collab.doc_state.len()
);
if let Err(err) = w_txn.flush_doc(
new_uid,
&new_object_id,
encoded_collab.state_vector.to_vec(),
encoded_collab.doc_state.to_vec(),
) {
error!("import collab:{} failed: {:?}", new_object_id, err);
}
}
} else {
event!(tracing::Level::ERROR, "decode v1 failed");
@ -754,7 +757,8 @@ where
.into_iter()
.filter_map(|(oid, collab)| {
collab
.encode_collab_v1()
.encode_collab_v1(|_| Ok::<(), PersistenceError>(()))
.ok()?
.encode_to_bytes()
.ok()
.map(|encoded_collab| (oid, encoded_collab))