@spacelr/sdk 0.19.0 → 0.19.2

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/index.js CHANGED
@@ -1175,6 +1175,18 @@ var RealtimeClient = class {
1175
1175
  if (ack.error) {
1176
1176
  const message = ack.message ?? ack.error;
1177
1177
  const err = new SpacelrError(message, ack.error);
1178
+ if (keepOnConnectFailure && ack.error === "disconnected" && !this.disposed) {
1179
+ for (const sibling of [...this.streamSubscriptions.get(subscriptionKey) ?? []]) {
1180
+ try {
1181
+ sibling.options.onError?.(err);
1182
+ } catch {
1183
+ }
1184
+ }
1185
+ return {
1186
+ unsubscribe: () => this.unsubscribeStream(state),
1187
+ ack: syntheticAck
1188
+ };
1189
+ }
1178
1190
  this.evictStreamKey(subscriptionKey, err, state);
1179
1191
  options.onError?.(err);
1180
1192
  throw err;
@@ -4345,7 +4357,8 @@ var NotificationsModule = class _NotificationsModule {
4345
4357
  if (!stored) return;
4346
4358
  await this.deleteSubscription(
4347
4359
  stored.subscription.platform,
4348
- _NotificationsModule.identifierOf(stored.subscription)
4360
+ _NotificationsModule.identifierOf(stored.subscription),
4361
+ true
4349
4362
  ).catch(() => void 0);
4350
4363
  });
4351
4364
  let timer;
@@ -4362,7 +4375,7 @@ var NotificationsModule = class _NotificationsModule {
4362
4375
  this.pushQueue = run.catch(() => void 0);
4363
4376
  return run;
4364
4377
  }
4365
- deleteSubscription(platform, identifier) {
4378
+ deleteSubscription(platform, identifier, skipAuthRefresh = false) {
4366
4379
  const body = { platform };
4367
4380
  if (platform === "web") {
4368
4381
  body["endpoint"] = identifier;
@@ -4373,7 +4386,8 @@ var NotificationsModule = class _NotificationsModule {
4373
4386
  method: "DELETE",
4374
4387
  path: "/notifications/subscribe",
4375
4388
  body,
4376
- authenticated: true
4389
+ authenticated: true,
4390
+ skipAuthRefresh
4377
4391
  });
4378
4392
  }
4379
4393
  /** The value `unsubscribe()` identifies a subscription by: endpoint for web, token otherwise. */