@spacelr/sdk 0.19.0 → 0.19.1

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;