|
@@ -94,14 +94,18 @@ async fn delta_sync_with_server_push_delta() {
|
|
|
// ◀─────────────────┤ start ws connection
|
|
|
// │ │
|
|
|
// ◀─────────────────┤ notify with rev: 1
|
|
|
-// │ │
|
|
|
-// ┌───────────────────┐ │ │ ┌──────────────────────────┐
|
|
|
-// │ops: ["123"] rev: 3│ ├────Push Rev─────▶ │ops: ["abc", "123"] rev: 4│
|
|
|
-// └───────────────────┘ │ │ └──────────────────────────┘
|
|
|
-// ┌──────────────────────────┐ │ │ ┌────────────────────┐
|
|
|
-// │ops: ["abc", "123"] rev: 4│ ◀────Push Rev─────┤ │ops: ["abc"] rev: 4 │
|
|
|
-// └──────────────────────────┘ │ │ └────────────────────┘
|
|
|
-// │ │
|
|
|
+// ┌───────────────────┐ │ │
|
|
|
+// │ops: ["123"] rev: 3│ ├────Push Rev─────▶ transform
|
|
|
+// └───────────────────┘ │ │ ┌──────────────────────────┐
|
|
|
+// │ │ │ops: ["abc", "123"] rev: 4│
|
|
|
+// │ │ └──────────────────────────┘
|
|
|
+// │ │ ┌────────────────────────────────┐
|
|
|
+// compose ◀────Push Rev─────┤ │ops: ["abc", "retain 3"] rev: 4 │
|
|
|
+// │ │ └────────────────────────────────┘
|
|
|
+// ┌──────────────────────────┐ │
|
|
|
+// │ops: ["abc", "123"] rev: 4│ │
|
|
|
+// └──────────────────────────┘ │
|
|
|
+// │ │
|
|
|
#[actix_rt::test]
|
|
|
async fn delta_sync_while_local_rev_less_than_server_rev() {
|
|
|
let test = DocumentTest::new().await;
|
|
@@ -120,6 +124,31 @@ async fn delta_sync_while_local_rev_less_than_server_rev() {
|
|
|
.await;
|
|
|
}
|
|
|
|
|
|
+#[rustfmt::skip]
|
|
|
+// ┌─────────┐ ┌─────────┐
|
|
|
+// │ Server │ │ Client │
|
|
|
+// └─────────┘ └─────────┘
|
|
|
+// ┌───────────────────┐ │ │
|
|
|
+// │ops: ["123"] rev: 1│ │ │
|
|
|
+// └───────────────────┘ │ │
|
|
|
+// ◀── http request ─┤ Open doc
|
|
|
+// │ │
|
|
|
+// │ │ ┌───────────────┐
|
|
|
+// ├──http response──┼──▶│ops: [123] rev:│
|
|
|
+// │ │ └───────────────┘
|
|
|
+// │ │ ┌──────────────────────────────────┐
|
|
|
+// │ │ │ops: ["123","abc", "efg"] rev: 3 │
|
|
|
+// │ │ └──────────────────────────────────┘
|
|
|
+// ◀─────────────────┤ start ws connection
|
|
|
+// │ │
|
|
|
+// ◀─────────────────┤ notify with rev: 3
|
|
|
+// │ │
|
|
|
+// ├────Pull Rev─────▶
|
|
|
+// │ │ ┌──────────────────────────────────┐
|
|
|
+// compose ◀────Push Rev─────┤ │ops: ["retain 3", "abcefg"] rev: 3│
|
|
|
+// ┌──────────────────────────────────┐│ │ └──────────────────────────────────┘
|
|
|
+// │ops: ["123","abc", "efg"] rev: 3 ││ │
|
|
|
+// └──────────────────────────────────┘│ │
|
|
|
#[actix_rt::test]
|
|
|
async fn delta_sync_while_local_rev_greater_than_server_rev() {
|
|
|
let test = DocumentTest::new().await;
|