@reactoo/watchtogether-sdk-js 2.7.44-beta.3 → 2.7.44-beta.5

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.
@@ -16878,6 +16878,9 @@ let iot = function () {
16878
16878
  },
16879
16879
  checkConnection: () => {
16880
16880
  return this.__privates.iot.checkConnection().catch(error => {
16881
+ if ((error === null || error === void 0 ? void 0 : error.cause) === -1) {
16882
+ return;
16883
+ }
16881
16884
  if (!shouldBeConnected) {
16882
16885
  this.__privates.iot.log('Ignoring connection check failure, not connected');
16883
16886
  return Promise.resolve();
@@ -16887,9 +16890,13 @@ let iot = function () {
16887
16890
  });
16888
16891
  },
16889
16892
  setupKeepAliveInterval: () => {
16893
+ this.__privates.iot.log('Setting up keepalive interval');
16890
16894
  clearInterval(keepAliveIntervalId);
16891
16895
  keepAliveIntervalId = setInterval(() => {
16892
16896
  this.__privates.iot.checkConnection().catch(error => {
16897
+ if ((error === null || error === void 0 ? void 0 : error.cause) === -1) {
16898
+ return;
16899
+ }
16893
16900
  if (!document.hidden && shouldBeConnected && !isReconnecting) {
16894
16901
  this.__privates.iot.log('Keepalive failed:', error);
16895
16902
  this.iot.__updateCredentials();
@@ -25549,17 +25556,18 @@ class Iot {
25549
25556
  return;
25550
25557
  }
25551
25558
  if (this.subscribedTopics.size === 0) {
25552
- reject(new Error('No subscribed topics available for connection check'));
25559
+ reject(new Error('No subscribed topics available for connection check', {
25560
+ cause: -1
25561
+ }));
25553
25562
  return;
25554
25563
  }
25555
25564
 
25556
25565
  // Find a suitable topic for the connection check
25557
25566
  let suitableTopic = Array.from(this.subscribedTopics).find(topic => topic.indexOf('user') > -1);
25558
25567
  if (!suitableTopic) {
25559
- suitableTopic = Array.from(this.subscribedTopics).find(topic => topic.indexOf('room') > -1 && topic !== 'wt/instanceroom/reactooDemo');
25560
- }
25561
- if (!suitableTopic) {
25562
- reject(new Error('No suitable topic found for connection check'));
25568
+ reject(new Error('No suitable topic found for connection check', {
25569
+ cause: -1
25570
+ }));
25563
25571
  return;
25564
25572
  }
25565
25573
  const testMessage = {