@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.
@@ -1885,11 +1885,11 @@ class HocuspocusProvider extends EventEmitter {
1885
1885
  },
1886
1886
  });
1887
1887
  }
1888
- catch (err) {
1889
- // If we aborted the connection attempt then don't throw an error
1888
+ catch (error) {
1889
+ // If we aborted the connection attempt then dont throw an error
1890
1890
  // ref: https://github.com/lifeomic/attempt/blob/master/src/index.ts#L136
1891
- if (err.code !== 'ATTEMPT_ABORTED') {
1892
- throw err;
1891
+ if (error && error.code !== 'ATTEMPT_ABORTED') {
1892
+ throw error;
1893
1893
  }
1894
1894
  }
1895
1895
  }
@@ -2049,7 +2049,6 @@ class HocuspocusProvider extends EventEmitter {
2049
2049
  return;
2050
2050
  }
2051
2051
  this.startSync();
2052
- this.resolveConnectionAttempt();
2053
2052
  }
2054
2053
  startSync() {
2055
2054
  this.send(SyncStepOneMessage, { document: this.document });
@@ -2071,6 +2070,7 @@ class HocuspocusProvider extends EventEmitter {
2071
2070
  }
2072
2071
  }
2073
2072
  onMessage(event) {
2073
+ this.resolveConnectionAttempt();
2074
2074
  this.lastMessageReceived = getUnixTime();
2075
2075
  const message = new IncomingMessage(event.data);
2076
2076
  this.emit('message', { event, message });