diff --git a/yorkie/proto/src/main/proto/yorkie/v1/yorkie.proto b/yorkie/proto/src/main/proto/yorkie/v1/yorkie.proto index 377b269b8..46e93fd05 100644 --- a/yorkie/proto/src/main/proto/yorkie/v1/yorkie.proto +++ b/yorkie/proto/src/main/proto/yorkie/v1/yorkie.proto @@ -48,6 +48,7 @@ message ActivateClientResponse { } message DeactivateClientRequest { + string client_key = 2; string client_id = 1; } @@ -55,6 +56,7 @@ message DeactivateClientResponse { } message AttachDocumentRequest { + string client_key = 3; string client_id = 1; ChangePack change_pack = 2; } @@ -65,6 +67,7 @@ message AttachDocumentResponse { } message DetachDocumentRequest { + string client_key = 5; string client_id = 1; string document_id = 2; ChangePack change_pack = 3; @@ -76,7 +79,9 @@ message DetachDocumentResponse { } message WatchDocumentRequest { + string client_key = 4; string client_id = 1; + string document_key = 3; string document_id = 2; } @@ -92,6 +97,7 @@ message WatchDocumentResponse { } message RemoveDocumentRequest { + string client_key = 4; string client_id = 1; string document_id = 2; ChangePack change_pack = 3; @@ -102,6 +108,7 @@ message RemoveDocumentResponse { } message PushPullChangesRequest { + string client_key = 5; string client_id = 1; string document_id = 2; ChangePack change_pack = 3; @@ -113,7 +120,9 @@ message PushPullChangesResponse { } message BroadcastRequest { + string client_key = 6; string client_id = 1; + string document_key = 5; string document_id = 2; string topic = 3; bytes payload = 4; @@ -121,4 +130,3 @@ message BroadcastRequest { message BroadcastResponse { } - diff --git a/yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeSplitMergeTest.kt b/yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeSplitMergeTest.kt index 9c68bde9e..cbc20773d 100644 --- a/yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeSplitMergeTest.kt +++ b/yorkie/src/androidTest/kotlin/dev/yorkie/document/json/JsonTreeSplitMergeTest.kt @@ -244,7 +244,7 @@ class JsonTreeSplitMergeTest { } @Test - fun test_split_and_merge_with_empty_paragraph_left_and_multiple_split_level_left() { + fun test_split_and_merge_with_empty_paragraph_and_multiple_split_level_left() { withTwoClientsAndDocuments(realTimeSync = false) { c1, c2, d1, d2, _ -> d1.updateAsync { root, _ -> root.setNewTree( diff --git a/yorkie/src/main/kotlin/dev/yorkie/core/Client.kt b/yorkie/src/main/kotlin/dev/yorkie/core/Client.kt index c4d01d25b..35413ccb5 100644 --- a/yorkie/src/main/kotlin/dev/yorkie/core/Client.kt +++ b/yorkie/src/main/kotlin/dev/yorkie/core/Client.kt @@ -207,6 +207,7 @@ public class Client @VisibleForTesting internal constructor( changePack = document.createChangePack().toPBChangePack() documentId = documentID pushOnly = syncMode == SyncMode.PushOnly + clientKey = options.key } val response = service.pushPullChanges( request, @@ -257,6 +258,8 @@ public class Client @VisibleForTesting internal constructor( watchDocumentRequest { clientId = requireClientId().value documentId = attachment.documentID + clientKey = options.key + documentKey = attachment.document.key.value }, documentBasedRequestHeader(attachment.document.key), ).retry { @@ -350,6 +353,7 @@ public class Client @VisibleForTesting internal constructor( val request = attachDocumentRequest { clientId = requireClientId().value changePack = document.createChangePack().toPBChangePack() + clientKey = options.key } val response = try { service.attachDocument( @@ -402,6 +406,7 @@ public class Client @VisibleForTesting internal constructor( clientId = requireClientId().value changePack = document.createChangePack().toPBChangePack() documentId = attachment.documentID + clientKey = options.key } val response = try { service.detachDocument( @@ -437,6 +442,7 @@ public class Client @VisibleForTesting internal constructor( service.deactivateClient( deactivateClientRequest { clientId = requireClientId().value + clientKey = options.key }, projectBasedRequestHeader, ) @@ -464,6 +470,7 @@ public class Client @VisibleForTesting internal constructor( clientId = requireClientId().value changePack = document.createChangePack(forceRemove = true).toPBChangePack() documentId = attachment.documentID + clientKey = options.key } val response = try { service.removeDocument(