@liveblocks/core 2.11.0 → 2.11.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.d.mts CHANGED
@@ -3167,15 +3167,20 @@ declare function asPos(str: string): Pos;
3167
3167
  declare function shallow(a: unknown, b: unknown): boolean;
3168
3168
 
3169
3169
  /**
3170
- * A datastructure to keep elements in ascending order, defined by a key
3171
- * function, i.e.
3172
- *
3173
- * const sorted = SortedList.from([{ id: 1 }, { id: 4 }, { id: 4 }, { id: 9 }], x => x.id)
3170
+ * A datastructure to keep elements in ascending order, as defined by the "less
3171
+ * than" function you provide. The elements will be ordered according to
3172
+ * whatever you define as the "less than" for this element type, so that every
3173
+ * element is less than its successor in the list.
3174
+ *
3175
+ * const sorted = SortedList.from(
3176
+ * [{ id: 4 }, { id: 1 }, { id: 9 }, { id: 4 }],
3177
+ * (a, b) => a.id < b.id)
3178
+ * )
3174
3179
  * sorted.add({ id: 5 })
3175
- * sorted.remove({ id: 4 })
3180
+ * sorted.remove({ id: 4 }) // Assuming it's the same obj ref!
3176
3181
  *
3177
3182
  * Array.from(sorted)
3178
- * [{ id: 1 }, { id: 4 }, { id: 4 }, { id: 5 }, { id: 9 }])
3183
+ * [{ id: 1 }, { id: 4 }, { id: 5 }, { id: 9 }])
3179
3184
  */
3180
3185
  declare class SortedList<T> {
3181
3186
  private _data;
package/dist/index.d.ts CHANGED
@@ -3167,15 +3167,20 @@ declare function asPos(str: string): Pos;
3167
3167
  declare function shallow(a: unknown, b: unknown): boolean;
3168
3168
 
3169
3169
  /**
3170
- * A datastructure to keep elements in ascending order, defined by a key
3171
- * function, i.e.
3172
- *
3173
- * const sorted = SortedList.from([{ id: 1 }, { id: 4 }, { id: 4 }, { id: 9 }], x => x.id)
3170
+ * A datastructure to keep elements in ascending order, as defined by the "less
3171
+ * than" function you provide. The elements will be ordered according to
3172
+ * whatever you define as the "less than" for this element type, so that every
3173
+ * element is less than its successor in the list.
3174
+ *
3175
+ * const sorted = SortedList.from(
3176
+ * [{ id: 4 }, { id: 1 }, { id: 9 }, { id: 4 }],
3177
+ * (a, b) => a.id < b.id)
3178
+ * )
3174
3179
  * sorted.add({ id: 5 })
3175
- * sorted.remove({ id: 4 })
3180
+ * sorted.remove({ id: 4 }) // Assuming it's the same obj ref!
3176
3181
  *
3177
3182
  * Array.from(sorted)
3178
- * [{ id: 1 }, { id: 4 }, { id: 4 }, { id: 5 }, { id: 9 }])
3183
+ * [{ id: 1 }, { id: 4 }, { id: 5 }, { id: 9 }])
3179
3184
  */
3180
3185
  declare class SortedList<T> {
3181
3186
  private _data;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "2.11.0";
9
+ var PKG_VERSION = "2.11.1";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -6619,7 +6619,15 @@ ${Array.from(traces).join("\n\n")}`
6619
6619
  threads: [],
6620
6620
  inboxNotifications: [],
6621
6621
  nextCursor: null,
6622
- requestedAt: /* @__PURE__ */ new Date()
6622
+ //
6623
+ // HACK
6624
+ // requestedAt needs to be a *server* timestamp here. However, on
6625
+ // this 404 error response, there is no such timestamp. So out of
6626
+ // pure necessity we'll fall back to a local timestamp instead (and
6627
+ // allow for a possible 6 hour clock difference between client and
6628
+ // server).
6629
+ //
6630
+ requestedAt: new Date(Date.now() - 6 * 60 * 60 * 1e3)
6623
6631
  };
6624
6632
  }
6625
6633
  throw err;