@hocuspocus/provider 1.0.0-alpha.22 → 1.0.0-alpha.23
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.
- package/dist/hocuspocus-provider.cjs +5 -5
- package/dist/hocuspocus-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js +5 -5
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/server/src/types.d.ts +5 -0
- package/package.json +2 -2
- package/src/HocuspocusProvider.ts +6 -6
|
@@ -1909,11 +1909,11 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
1909
1909
|
},
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
catch (
|
|
1913
|
-
// If we aborted the connection attempt then don
|
|
1912
|
+
catch (error) {
|
|
1913
|
+
// If we aborted the connection attempt then don’t throw an error
|
|
1914
1914
|
// ref: https://github.com/lifeomic/attempt/blob/master/src/index.ts#L136
|
|
1915
|
-
if (
|
|
1916
|
-
throw
|
|
1915
|
+
if (error && error.code !== 'ATTEMPT_ABORTED') {
|
|
1916
|
+
throw error;
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
@@ -2073,7 +2073,6 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
2073
2073
|
return;
|
|
2074
2074
|
}
|
|
2075
2075
|
this.startSync();
|
|
2076
|
-
this.resolveConnectionAttempt();
|
|
2077
2076
|
}
|
|
2078
2077
|
startSync() {
|
|
2079
2078
|
this.send(SyncStepOneMessage, { document: this.document });
|
|
@@ -2095,6 +2094,7 @@ class HocuspocusProvider extends EventEmitter {
|
|
|
2095
2094
|
}
|
|
2096
2095
|
}
|
|
2097
2096
|
onMessage(event) {
|
|
2097
|
+
this.resolveConnectionAttempt();
|
|
2098
2098
|
this.lastMessageReceived = getUnixTime();
|
|
2099
2099
|
const message = new IncomingMessage(event.data);
|
|
2100
2100
|
this.emit('message', { event, message });
|