@fluid-app/portal-sdk 0.1.415 → 0.1.416

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.
@@ -33,7 +33,7 @@ import "./MediaRenderer-BydUiy9x.mjs";
33
33
  import "./CarouselWidget-CRJ_4exb.mjs";
34
34
  import "./CatchUpWidget-BmdYyvtU.mjs";
35
35
  import "./src-CAi8-qUm.mjs";
36
- import { n as messagingScreenPropertySchema, t as MessagingScreen } from "./MessagingScreen-BqA9nLK3.mjs";
36
+ import { n as messagingScreenPropertySchema, t as MessagingScreen } from "./MessagingScreen-DEGSn8mb.mjs";
37
37
  import "./ChartWidget-DGOy0VqF.mjs";
38
38
  import "./ContainerWidget-swMSaIoO.mjs";
39
39
  import "./EmbedWidget-CnjwfFDK.mjs";
@@ -2865,17 +2865,7 @@ function useMessagingCable(options) {
2865
2865
  let messageSub = null;
2866
2866
  let appearanceSub = null;
2867
2867
  let notificationsSub = null;
2868
- let tornDown = false;
2869
- let retryCount = 0;
2870
- let retryTimeout = null;
2871
- const MAX_RETRIES = 5;
2872
- const BASE_RETRY_DELAY = 2e3;
2873
2868
  const teardown = () => {
2874
- tornDown = true;
2875
- if (retryTimeout) {
2876
- clearTimeout(retryTimeout);
2877
- retryTimeout = null;
2878
- }
2879
2869
  try {
2880
2870
  messageSub?.unsubscribe();
2881
2871
  } catch (err) {
@@ -3062,42 +3052,23 @@ function useMessagingCable(options) {
3062
3052
  }
3063
3053
  console.debug("[ws] notification", parsed.data);
3064
3054
  };
3065
- const attemptReconnect = (url) => {
3066
- if (tornDown) return;
3067
- if (retryTimeout !== null) return;
3068
- retryCount++;
3069
- if (retryCount > MAX_RETRIES) {
3070
- console.error(`[ws] max retries (${MAX_RETRIES}) exceeded, giving up reconnection`);
3071
- return;
3072
- }
3073
- const delay = Math.min(BASE_RETRY_DELAY * Math.pow(2, retryCount - 1), 3e4);
3074
- console.debug(`[ws] reconnecting in ${delay}ms (attempt ${retryCount}/${MAX_RETRIES})`);
3075
- retryTimeout = setTimeout(() => {
3076
- retryTimeout = null;
3077
- if (!tornDown) connectAt(url, () => {
3078
- retryCount = 0;
3079
- });
3080
- }, delay);
3081
- };
3082
- const connectAt = (url, onFirstConnected) => {
3055
+ const connectAt = (url) => {
3083
3056
  try {
3084
3057
  consumer = import_actioncable.createConsumer(`${url}?token=${token}`);
3085
3058
  } catch (err) {
3086
3059
  console.error("[ws] failed to create consumer", err);
3087
- attemptReconnect(url);
3088
3060
  return;
3089
3061
  }
3090
3062
  let reported = false;
3091
3063
  const report = () => {
3092
3064
  if (!reported) {
3093
3065
  reported = true;
3094
- onFirstConnected();
3095
3066
  console.debug("[ws] open", url);
3096
3067
  }
3097
3068
  };
3098
3069
  const handleDisconnect = (channelName) => {
3070
+ reported = false;
3099
3071
  console.debug(`[ws] close: ${channelName}`);
3100
- if (!tornDown) attemptReconnect(url);
3101
3072
  };
3102
3073
  try {
3103
3074
  if (recipientId) messageSub = consumer.subscriptions.create({
@@ -3115,7 +3086,6 @@ function useMessagingCable(options) {
3115
3086
  },
3116
3087
  rejected: () => {
3117
3088
  console.error("[ws] message subscription rejected");
3118
- attemptReconnect(url);
3119
3089
  }
3120
3090
  });
3121
3091
  if (companyId) appearanceSub = consumer.subscriptions.create({
@@ -3133,7 +3103,6 @@ function useMessagingCable(options) {
3133
3103
  },
3134
3104
  rejected: () => {
3135
3105
  console.error("[ws] appearance subscription rejected");
3136
- attemptReconnect(url);
3137
3106
  }
3138
3107
  });
3139
3108
  notificationsSub = consumer.subscriptions.create({ channel: "NotificationsChannel" }, {
@@ -3148,20 +3117,17 @@ function useMessagingCable(options) {
3148
3117
  },
3149
3118
  rejected: () => {
3150
3119
  console.error("[ws] notifications subscription rejected");
3151
- attemptReconnect(url);
3152
3120
  }
3153
3121
  });
3154
3122
  } catch (err) {
3155
3123
  console.error("[ws] failed to create subscriptions", err);
3156
3124
  teardown();
3157
- attemptReconnect(url);
3158
3125
  }
3159
3126
  };
3160
3127
  try {
3161
- connectAt(websocketUrl, () => {});
3128
+ connectAt(websocketUrl);
3162
3129
  } catch (err) {
3163
3130
  console.error("[ws] failed to connect", err);
3164
- attemptReconnect(websocketUrl);
3165
3131
  }
3166
3132
  return () => {
3167
3133
  teardown();
@@ -56580,4 +56546,4 @@ Object.defineProperty(exports, "useMessagingConfig", {
56580
56546
  }
56581
56547
  });
56582
56548
 
56583
- //# sourceMappingURL=MessagingScreen-DVz7cYnY.cjs.map
56549
+ //# sourceMappingURL=MessagingScreen-JZNWyshx.cjs.map