You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The watch stream should not automatically reconnect when it has been explicitly cancelled, such as when:
Detaching a document
Switching to manual sync mode
In the quill-two-clients.html example, when switching to manual sync mode, the watch stream:
Disconnects (unwatches) as expected
Unexpectedly reconnects automatically
quill-two-clients2.mov
The watch stream reconnection occurs because:
cancelWatchStream(abort) triggers a ConnectErrorCode.Canceled error
This error is currently marked as retryable, causing automatic reconnection attempts
We need to:
Identify all scenarios that generate ConnectErrorCode.Canceled errors besides explicit abort
Evaluate whether each scenario should be retryable
Differentiate between intentional cancellation and other cancellation scenarios
What you expected to happen:
Once explicitly cancelled (e.g., by switching to manual sync mode), the watch stream should:
Remain disconnected
Not attempt automatic reconnection
How to reproduce it (as minimally and precisely as possible):
Run quill-two-clients.html
Or Add a test case to verify this behavior
it('Should cancel watch stream when changing to manual sync mode',asyncfunction({
task,}){// Test setup with two clientsconstc1=newyorkie.Client(testRPCAddr);constc2=newyorkie.Client(testRPCAddr);awaitc1.activate();awaitc2.activate();// Create and attach documentsconstdocKey=toDocKey(`${task.name}-${newDate().getTime()}`);constd1=newyorkie.Document<{version: string}>(docKey);constd2=newyorkie.Document<{version: string}>(docKey);awaitc1.attach(d1);awaitc2.attach(d2);// Set up event collectorsconstsyncEventCollector=newEventCollector();constpresenceEventCollector=newEventCollector();// Verify initial sync worksd2.update((root)=>{root.version='v1';});awaitsyncEventCollector.waitFor(DocEventType.RemoteChange);assert.equal(d1.toSortedJSON(),`{"version":"v1"}`);// Switch to manual mode and verify stream closesawaitc1.changeSyncMode(d1,SyncMode.Manual);awaitpresenceEventCollector.waitFor(DocEventType.Unwatched);// Verify stream stays closedd2.update((root)=>{root.version='v2';});awaitnewPromise((resolve)=>setTimeout(resolve,1000));assert.equal(presenceEventCollector.getLength(),0);assert.equal(d1.toSortedJSON(),`{"version":"v1"}`,'keeps old value');// Verify manual sync still worksawaitc1.sync();assert.equal(d1.toSortedJSON(),`{"version":"v2"}`,'manual sync');});
Anything else we need to know?:
Environment:
Operating system:
Browser and version:
Yorkie version (use yorkie version):
Yorkie JS SDK version: v0.5.3
The text was updated successfully, but these errors were encountered:
What happened:
The watch stream should not automatically reconnect when it has been explicitly cancelled, such as when:
In the
quill-two-clients.html
example, when switching to manual sync mode, the watch stream:quill-two-clients2.mov
The watch stream reconnection occurs because:
cancelWatchStream
(abort) triggers aConnectErrorCode.Canceled
errorretryable
, causing automatic reconnection attemptsWe need to:
ConnectErrorCode.Canceled
errors besides explicit abortWhat you expected to happen:
Once explicitly cancelled (e.g., by switching to manual sync mode), the watch stream should:
How to reproduce it (as minimally and precisely as possible):
Run
quill-two-clients.html
Or Add a test case to verify this behavior
Anything else we need to know?:
Environment:
yorkie version
):The text was updated successfully, but these errors were encountered: