Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update yrs and appflowy-collab #677

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,6 @@ jobs:
echo "Running tests for ${{ matrix.test_service }} with flags: ${{ matrix.test_cmd }}"
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test ${{ matrix.test_cmd }}

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Run WASM tests
working-directory: ./libs/wasm-test
run: |
cargo install wasm-pack
wasm-pack test --headless --firefox

cleanup:
name: Cleanup Docker Images
if: always()
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/wasm_ci.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/wasm_publish.yml

This file was deleted.

14 changes: 8 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pgvector = { version = "0.3", features = ["sqlx"] }
client-api-entity = { path = "libs/client-api-entity" }

# collaboration
yrs = "0.18.7"
yrs = "0.19.1"
collab = { version = "0.2.0" }
collab-entity = { version = "0.2.0" }
collab-folder = { version = "0.2.0" }
Expand All @@ -233,10 +233,10 @@ debug = true
[patch.crates-io]
# It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate.
# So using patch to workaround this issue.
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "870cd70" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "870cd70" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "870cd70" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "870cd70" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "20f7814" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "20f7814" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "20f7814" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "20f7814" }

[features]
history = []
2 changes: 1 addition & 1 deletion libs/collab-rt-entity/src/client_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl UpdateSync {
Some(Message::Sync(SyncMessage::Update(right))),
) = (self.as_update(), other.as_update())
{
let update = merge_updates_v1(&[&left, &right])?;
let update = merge_updates_v1([left, right])?;
let msg = Message::Sync(SyncMessage::Update(update));
let mut encoder = EncoderV1::new();
msg.encode(&mut encoder);
Expand Down
18 changes: 10 additions & 8 deletions services/appflowy-collaborate/src/group/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,17 @@ impl CollabBroadcast {
let cloned_oid = self.object_id.clone();

// Observer the awareness's update and broadcast it to all subscribers.
let awareness_sub = collab.lock().observe_awareness(move |event| {
if let Some(awareness_update) = event.awareness_update() {
let payload = Message::Awareness(awareness_update.clone()).encode_v1();
let msg = AwarenessSync::new(cloned_oid.clone(), payload, CollabOrigin::Empty);
if let Err(err) = broadcast_sink.send(msg.into()) {
trace!("fail to broadcast awareness:{}", err);
let awareness_sub = collab
.lock()
.observe_awareness(move |awareness, event, _origin| {
if let Ok(awareness_update) = awareness.update_with_clients(event.all_changes()) {
let payload = Message::Awareness(awareness_update).encode_v1();
let msg = AwarenessSync::new(cloned_oid.clone(), payload, CollabOrigin::Empty);
if let Err(err) = broadcast_sink.send(msg.into()) {
trace!("fail to broadcast awareness:{}", err);
}
}
}
});
});
(doc_sub, awareness_sub)
};

Expand Down
4 changes: 2 additions & 2 deletions src/biz/user/user_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use app_error::AppError;

use appflowy_collaborate::collab::storage::CollabAccessControlStorage;
use collab::core::origin::CollabOrigin;
use collab::preclude::{Any, Collab, MapPrelim};
use collab::preclude::{Any, Collab};
use collab_entity::define::WORKSPACE_DATABASES;
use collab_entity::CollabType;
use database::collab::CollabStorage;
Expand Down Expand Up @@ -85,7 +85,7 @@ async fn create_workspace_database_collab(
let collab_type = CollabType::WorkspaceDatabase;
let collab = Collab::new_with_origin(CollabOrigin::Empty, object_id, vec![], false);
let _ = collab.with_origin_transact_mut(|txn| {
collab.create_array_with_txn::<MapPrelim<Any>>(txn, WORKSPACE_DATABASES, vec![]);
collab.create_array_with_txn::<Any>(txn, WORKSPACE_DATABASES, vec![]);
Ok::<(), AppError>(())
});

Expand Down
2 changes: 1 addition & 1 deletion tests/collab/single_device_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ async fn same_device_multiple_connect_in_order_test() {
&object_id,
&collab_type,
10,
json!({"0":0.0,"1":1.0,"2":2.0}),
json!({"0":0,"1":1,"2":2}),
)
.await
.unwrap();
Expand Down
Loading