@yorkie-js/react 0.6.1-rc7 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7556,6 +7556,7 @@ var Code = /* @__PURE__ */ ((Code2) => {
|
|
|
7556
7556
|
Code2["ErrContextNotProvided"] = "ErrContextNotProvided";
|
|
7557
7557
|
Code2["ErrPermissionDenied"] = "ErrPermissionDenied";
|
|
7558
7558
|
Code2["ErrUnauthenticated"] = "ErrUnauthenticated";
|
|
7559
|
+
Code2["ErrTooManySubscribers"] = "ErrTooManySubscribers";
|
|
7559
7560
|
return Code2;
|
|
7560
7561
|
})(Code || {});
|
|
7561
7562
|
class YorkieError extends Error {
|
|
@@ -20173,7 +20174,7 @@ function createAuthInterceptor(apiKey, token) {
|
|
|
20173
20174
|
};
|
|
20174
20175
|
}
|
|
20175
20176
|
const name = "@yorkie-js/sdk";
|
|
20176
|
-
const version = "0.6.
|
|
20177
|
+
const version = "0.6.2";
|
|
20177
20178
|
const pkg = {
|
|
20178
20179
|
name,
|
|
20179
20180
|
version
|
|
@@ -20438,7 +20439,7 @@ class Client {
|
|
|
20438
20439
|
* the changes should be applied to other replicas before GC time. For this,
|
|
20439
20440
|
* if the document is no longer used by this client, it should be detached.
|
|
20440
20441
|
*/
|
|
20441
|
-
detach(doc, options = {}) {
|
|
20442
|
+
detach(doc, options = { keepalive: false }) {
|
|
20442
20443
|
if (!this.isActive()) {
|
|
20443
20444
|
throw new YorkieError(
|
|
20444
20445
|
Code.ErrClientNotActivated,
|
|
@@ -20453,8 +20454,8 @@ class Client {
|
|
|
20453
20454
|
);
|
|
20454
20455
|
}
|
|
20455
20456
|
doc.update((_, p) => p.clear());
|
|
20456
|
-
|
|
20457
|
-
return this.rpcClient.detachDocument(
|
|
20457
|
+
const task = async () => {
|
|
20458
|
+
return await this.rpcClient.detachDocument(
|
|
20458
20459
|
{
|
|
20459
20460
|
clientId: this.id,
|
|
20460
20461
|
documentId: attachment.docID,
|
|
@@ -20476,7 +20477,14 @@ class Client {
|
|
|
20476
20477
|
await this.handleConnectError(err);
|
|
20477
20478
|
throw err;
|
|
20478
20479
|
});
|
|
20479
|
-
}
|
|
20480
|
+
};
|
|
20481
|
+
if (options.keepalive) {
|
|
20482
|
+
this.keepalive = true;
|
|
20483
|
+
const resp = task();
|
|
20484
|
+
this.keepalive = false;
|
|
20485
|
+
return resp;
|
|
20486
|
+
}
|
|
20487
|
+
return this.enqueueTask(task);
|
|
20480
20488
|
}
|
|
20481
20489
|
/**
|
|
20482
20490
|
* `changeRealtimeSync` changes the synchronization mode of the given document.
|
|
@@ -20951,6 +20959,10 @@ class Client {
|
|
|
20951
20959
|
}
|
|
20952
20960
|
return true;
|
|
20953
20961
|
}
|
|
20962
|
+
if (errorCodeOf(err) === Code.ErrTooManySubscribers) {
|
|
20963
|
+
logger.error(`[WD] c:"${this.getKey()}" err :`, err.rawMessage);
|
|
20964
|
+
return true;
|
|
20965
|
+
}
|
|
20954
20966
|
if (errorCodeOf(err) === Code.ErrClientNotActivated || errorCodeOf(err) === Code.ErrClientNotFound) {
|
|
20955
20967
|
this.deactivateInternal();
|
|
20956
20968
|
}
|