@liveblocks/react 2.9.0 → 2.9.2-emails1

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.
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "2.9.0";
3
+ var PKG_VERSION = "2.9.2-emails1";
4
4
  var PKG_FORMAT = "esm";
5
5
 
6
6
  // src/ClientSideSuspense.tsx
@@ -64,7 +64,7 @@ function isMoreRecentlyUpdated(a, b) {
64
64
  return byMostRecentlyUpdated(a, b) < 0;
65
65
  }
66
66
  function byMostRecentlyUpdated(a, b) {
67
- return (b.updatedAt ?? b.createdAt).getTime() - (a.updatedAt ?? a.createdAt).getTime();
67
+ return b.updatedAt.getTime() - a.updatedAt.getTime();
68
68
  }
69
69
 
70
70
  // src/lib/guards.ts
@@ -87,8 +87,11 @@ function matchesMetadata(thread, q) {
87
87
  const metadata = thread.metadata;
88
88
  return q.metadata === void 0 || Object.entries(q.metadata).every(
89
89
  ([key, op]) => (
90
- // Boolean logic: op? => value matches the operator
91
- op === void 0 || matchesOperator(metadata[key], op)
90
+ // NOTE: `op` can be explicitly-`undefined` here, which ideally would not
91
+ // mean "filter for absence" like it does now, as this does not match the
92
+ // backend behavior at the moment. For an in-depth discussion, see
93
+ // https://liveblocks.slack.com/archives/C02PZL7QAAW/p1728546988505989
94
+ matchesOperator(metadata[key], op)
92
95
  )
93
96
  );
94
97
  }
@@ -595,7 +598,7 @@ var UmbrellaStore = class {
595
598
  if (existing.deletedAt !== void 0) {
596
599
  return cache;
597
600
  }
598
- if (!!updatedAt && !!existing.updatedAt && existing.updatedAt > updatedAt) {
601
+ if (!!updatedAt && existing.updatedAt > updatedAt) {
599
602
  return cache;
600
603
  }
601
604
  return { ...cache, [threadId]: callback(existing) };
@@ -780,7 +783,6 @@ var UmbrellaStore = class {
780
783
  async fetchNotificationsDeltaUpdate() {
781
784
  const lastRequestedAt = this._notificationsLastRequestedAt;
782
785
  if (lastRequestedAt === null) {
783
- console2.warn("Notifications polled before first page loaded");
784
786
  return;
785
787
  }
786
788
  const client = nn(
@@ -844,7 +846,6 @@ var UmbrellaStore = class {
844
846
  async fetchRoomThreadsDeltaUpdate(roomId) {
845
847
  const lastRequestedAt = this._roomThreadsLastRequestedAtByRoom.get(roomId);
846
848
  if (lastRequestedAt === void 0) {
847
- console2.warn("Room threads polled before first page loaded");
848
849
  return;
849
850
  }
850
851
  const client = nn(
@@ -907,7 +908,6 @@ var UmbrellaStore = class {
907
908
  async fetchUserThreadsDeltaUpdate() {
908
909
  const lastRequestedAt = this._userThreadsLastRequestedAt;
909
910
  if (lastRequestedAt === null) {
910
- console2.warn("User threads polled before first page loaded");
911
911
  return;
912
912
  }
913
913
  const client = nn(
@@ -948,7 +948,7 @@ function internalToExternalState(state) {
948
948
  if (thread.deletedAt !== void 0) {
949
949
  break;
950
950
  }
951
- if (thread.updatedAt !== void 0 && thread.updatedAt > optimisticUpdate.updatedAt) {
951
+ if (thread.updatedAt > optimisticUpdate.updatedAt) {
952
952
  break;
953
953
  }
954
954
  computed.threadsById[thread.id] = {
@@ -1211,7 +1211,7 @@ function applyUpsertComment(thread, comment) {
1211
1211
  );
1212
1212
  if (existingComment === void 0) {
1213
1213
  const updatedAt = new Date(
1214
- Math.max(thread.updatedAt?.getTime() || 0, comment.createdAt.getTime())
1214
+ Math.max(thread.updatedAt.getTime(), comment.createdAt.getTime())
1215
1215
  );
1216
1216
  const updatedThread = {
1217
1217
  ...thread,
@@ -1231,7 +1231,7 @@ function applyUpsertComment(thread, comment) {
1231
1231
  ...thread,
1232
1232
  updatedAt: new Date(
1233
1233
  Math.max(
1234
- thread.updatedAt?.getTime() || 0,
1234
+ thread.updatedAt.getTime(),
1235
1235
  comment.editedAt?.getTime() || comment.createdAt.getTime()
1236
1236
  )
1237
1237
  ),
@@ -1298,7 +1298,7 @@ function applyAddReaction(thread, commentId, reaction) {
1298
1298
  return {
1299
1299
  ...thread,
1300
1300
  updatedAt: new Date(
1301
- Math.max(reaction.createdAt.getTime(), thread.updatedAt?.getTime() || 0)
1301
+ Math.max(reaction.createdAt.getTime(), thread.updatedAt.getTime())
1302
1302
  ),
1303
1303
  comments: updatedComments
1304
1304
  };
@@ -1331,7 +1331,7 @@ function applyRemoveReaction(thread, commentId, emoji, userId, removedAt) {
1331
1331
  return {
1332
1332
  ...thread,
1333
1333
  updatedAt: new Date(
1334
- Math.max(removedAt.getTime(), thread.updatedAt?.getTime() || 0)
1334
+ Math.max(removedAt.getTime(), thread.updatedAt.getTime())
1335
1335
  ),
1336
1336
  comments: updatedComments
1337
1337
  };
@@ -3850,4 +3850,4 @@ export {
3850
3850
  _useStorageRoot,
3851
3851
  _useUpdateMyPresence
3852
3852
  };
3853
- //# sourceMappingURL=chunk-V7FAMENR.mjs.map
3853
+ //# sourceMappingURL=chunk-XBY6DFJ2.mjs.map