@liveblocks/node 2.22.4-emails2 → 2.23.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
@@ -3,7 +3,7 @@ import { detectDupes } from "@liveblocks/core";
3
3
 
4
4
  // src/version.ts
5
5
  var PKG_NAME = "@liveblocks/node";
6
- var PKG_VERSION = "2.22.4-emails2";
6
+ var PKG_VERSION = "2.23.1";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -16,6 +16,7 @@ import {
16
16
  convertToThreadData,
17
17
  createManagedPool,
18
18
  createUserNotificationSettings,
19
+ isPlainObject,
19
20
  LiveObject,
20
21
  makeAbortController,
21
22
  objectToQuery,
@@ -707,9 +708,12 @@ var Liveblocks = class {
707
708
  }
708
709
  const stream = resp.body.pipeThrough(new TextDecoderStream()).pipeThrough(new LineStream()).pipeThrough(new NdJsonStream());
709
710
  const iter = stream[Symbol.asyncIterator]();
710
- const { actor } = await iter.next();
711
+ const first = (await iter.next()).value;
712
+ if (!isPlainObject(first) || typeof first.actor !== "number") {
713
+ throw new Error("Failed to obtain a unique session");
714
+ }
711
715
  const nodes = await asyncConsume(iter);
712
- return { actor, nodes };
716
+ return { actor: first.actor, nodes };
713
717
  }
714
718
  /**
715
719
  * Initializes a room’s Storage. The room must already exist and have an empty Storage.