@liveblocks/react 2.23.1 → 2.24.0-sub1

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.
@@ -132,8 +132,8 @@ var config = {
132
132
  USER_THREADS_MAX_STALE_TIME: 30 * SECONDS,
133
133
  HISTORY_VERSIONS_POLL_INTERVAL: 1 * MINUTES,
134
134
  HISTORY_VERSIONS_MAX_STALE_TIME: 5 * SECONDS,
135
- NOTIFICATION_SETTINGS_POLL_INTERVAL: 1 * MINUTES,
136
- NOTIFICATION_SETTINGS_MAX_STALE_TIME: 5 * SECONDS,
135
+ ROOM_SUBSCRIPTION_SETTINGS_POLL_INTERVAL: 1 * MINUTES,
136
+ ROOM_SUBSCRIPTION_SETTINGS_MAX_STALE_TIME: 5 * SECONDS,
137
137
  USER_NOTIFICATION_SETTINGS_INTERVAL: 5 * MINUTES,
138
138
  USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME: 1 * MINUTES
139
139
  };
@@ -232,18 +232,21 @@ var use = (
232
232
 
233
233
  // src/umbrella-store.ts
234
234
  import {
235
+ assertNever,
235
236
  autoRetry,
236
237
  batch as batch2,
237
238
  compactObject,
238
239
  console as console2,
239
- createUserNotificationSettings,
240
+ createNotificationSettings,
240
241
  DefaultMap,
241
242
  DerivedSignal,
243
+ getMentionedIdsFromCommentBody,
244
+ getSubscriptionKey,
242
245
  kInternal,
243
246
  MutableSignal as MutableSignal2,
244
247
  nanoid,
245
248
  nn,
246
- patchUserNotificationSettings,
249
+ patchNotificationSettings,
247
250
  shallow as shallow3,
248
251
  Signal,
249
252
  stableStringify
@@ -431,7 +434,9 @@ var ThreadDB = class _ThreadDB {
431
434
  if (roomId !== void 0) {
432
435
  crit.push((t) => t.roomId === roomId);
433
436
  }
434
- crit.push(makeThreadsFilter(query));
437
+ if (query !== void 0) {
438
+ crit.push(makeThreadsFilter(query));
439
+ }
435
440
  return Array.from(index.filter((t) => crit.every((pred) => pred(t))));
436
441
  }
437
442
  };
@@ -667,7 +672,45 @@ function createStore_forNotifications() {
667
672
  upsert
668
673
  };
669
674
  }
670
- function createStore_forRoomNotificationSettings(updates) {
675
+ function createStore_forSubscriptions(updates, threads) {
676
+ const baseSignal = new MutableSignal2(/* @__PURE__ */ new Map());
677
+ function applyDelta(newSubscriptions, deletedSubscriptions) {
678
+ baseSignal.mutate((lut) => {
679
+ let mutated = false;
680
+ for (const s of newSubscriptions) {
681
+ lut.set(getSubscriptionKey(s), s);
682
+ mutated = true;
683
+ }
684
+ for (const s of deletedSubscriptions) {
685
+ lut.delete(getSubscriptionKey(s));
686
+ mutated = true;
687
+ }
688
+ return mutated;
689
+ });
690
+ }
691
+ function create(subscription) {
692
+ baseSignal.mutate((lut) => {
693
+ lut.set(getSubscriptionKey(subscription), subscription);
694
+ });
695
+ }
696
+ function deleteOne(subscriptionKey) {
697
+ baseSignal.mutate((lut) => {
698
+ lut.delete(subscriptionKey);
699
+ });
700
+ }
701
+ return {
702
+ signal: DerivedSignal.from(
703
+ baseSignal,
704
+ updates,
705
+ (base, updates2) => applyOptimisticUpdates_forSubscriptions(base, threads, updates2)
706
+ ),
707
+ // Mutations
708
+ applyDelta,
709
+ create,
710
+ delete: deleteOne
711
+ };
712
+ }
713
+ function createStore_forRoomSubscriptionSettings(updates) {
671
714
  const baseSignal = new MutableSignal2(/* @__PURE__ */ new Map());
672
715
  function update(roomId, settings) {
673
716
  baseSignal.mutate((lut) => {
@@ -678,7 +721,7 @@ function createStore_forRoomNotificationSettings(updates) {
678
721
  signal: DerivedSignal.from(
679
722
  baseSignal,
680
723
  updates,
681
- (base, updates2) => applyOptimisticUpdates_forSettings(base, updates2)
724
+ (base, updates2) => applyOptimisticUpdates_forRoomSubscriptionSettings(base, updates2)
682
725
  ),
683
726
  // Mutations
684
727
  update
@@ -730,9 +773,9 @@ function createStore_forPermissionHints() {
730
773
  update
731
774
  };
732
775
  }
733
- function createStore_forUserNotificationSettings(updates) {
776
+ function createStore_forNotificationSettings(updates) {
734
777
  const signal = new Signal(
735
- createUserNotificationSettings({})
778
+ createNotificationSettings({})
736
779
  );
737
780
  function update(settings) {
738
781
  signal.set(settings);
@@ -741,7 +784,7 @@ function createStore_forUserNotificationSettings(updates) {
741
784
  signal: DerivedSignal.from(
742
785
  signal,
743
786
  updates,
744
- (base, updates2) => applyOptimisticUpdates_forUserNotificationSettings(base, updates2)
787
+ (base, updates2) => applyOptimisticUpdates_forNotificationSettings(base, updates2)
745
788
  ),
746
789
  // Mutations
747
790
  update
@@ -780,16 +823,18 @@ var UmbrellaStore = class {
780
823
  //
781
824
  // Mutate inputs... ...observe clean/consistent output!
782
825
  //
783
- // .-> Base ThreadDB ---------+ +----> Clean threads by ID (Part 1)
826
+ // .-> Base ThreadDB ---------+ +-------> Clean threads by ID (Part 1)
784
827
  // / | |
785
- // mutate ----> Base Notifications --+ | | +--> Clean notifications (Part 1)
786
- // \ | | | | & notifications by ID
828
+ // mutate ----> Base Notifications --+ | | +-----> Clean notifications (Part 1)
829
+ // \ | | | | & notifications by ID
787
830
  // | \ | | Apply | |
788
- // | `-> OptimisticUpdates --+--+--> Optimistic --+-+--> Room Notification Settings (Part 2)
789
- // \ | Updates | |
790
- // `------- etc etc ---------+ | +--> History Versions (Part 3)
791
- // ^ |
792
- // | +-----> User Notification Settings (Part 4)
831
+ // | `-> OptimisticUpdates --+--+--> Optimistic -+-+-+-+-> Subscriptions (Part 2)
832
+ // \ | Updates | | |
833
+ // `------- etc etc ---------+ | | +-> History Versions (Part 3)
834
+ // ^ | |
835
+ // | | +---> Room Subscription Settings (Part 4)
836
+ // | |
837
+ // | +-------> Notification Settings (Part 5)
793
838
  // |
794
839
  // |
795
840
  // | ^ ^
@@ -807,11 +852,12 @@ var UmbrellaStore = class {
807
852
  threads;
808
853
  // Exposes its signal under `.signal` prop
809
854
  notifications;
810
- roomNotificationSettings;
855
+ subscriptions;
856
+ roomSubscriptionSettings;
811
857
  // prettier-ignore
812
858
  historyVersions;
813
859
  permissionHints;
814
- userNotificationSettings;
860
+ notificationSettings;
815
861
  optimisticUpdates;
816
862
  //
817
863
  // Output signals.
@@ -832,8 +878,8 @@ var UmbrellaStore = class {
832
878
  #userThreadsLastRequestedAt = null;
833
879
  // Room versions
834
880
  #roomVersionsLastRequestedAtByRoom = /* @__PURE__ */ new Map();
835
- // User Notification Settings
836
- #userNotificationSettings;
881
+ // Notification Settings
882
+ #notificationSettings;
837
883
  constructor(client) {
838
884
  this.#client = client[kInternal].as();
839
885
  this.optimisticUpdates = createStore_forOptimistic(this.#client);
@@ -841,7 +887,11 @@ var UmbrellaStore = class {
841
887
  this.#notificationsPaginationState = new PaginatedResource(
842
888
  async (cursor) => {
843
889
  const result = await this.#client.getInboxNotifications({ cursor });
844
- this.updateThreadifications(result.threads, result.inboxNotifications);
890
+ this.updateThreadifications(
891
+ result.threads,
892
+ result.inboxNotifications,
893
+ result.subscriptions
894
+ );
845
895
  if (this.#notificationsLastRequestedAt === null) {
846
896
  this.#notificationsLastRequestedAt = result.requestedAt;
847
897
  }
@@ -849,19 +899,23 @@ var UmbrellaStore = class {
849
899
  return nextCursor;
850
900
  }
851
901
  );
852
- const userNotificationSettingsFetcher = async () => {
902
+ const notificationSettingsFetcher = async () => {
853
903
  const result = await this.#client.getNotificationSettings();
854
- this.userNotificationSettings.update(result);
904
+ this.notificationSettings.update(result);
855
905
  };
856
- this.userNotificationSettings = createStore_forUserNotificationSettings(
906
+ this.notificationSettings = createStore_forNotificationSettings(
857
907
  this.optimisticUpdates.signal
858
908
  );
859
- this.#userNotificationSettings = new SinglePageResource(
860
- userNotificationSettingsFetcher
909
+ this.#notificationSettings = new SinglePageResource(
910
+ notificationSettingsFetcher
861
911
  );
862
912
  this.threads = new ThreadDB();
913
+ this.subscriptions = createStore_forSubscriptions(
914
+ this.optimisticUpdates.signal,
915
+ this.threads
916
+ );
863
917
  this.notifications = createStore_forNotifications();
864
- this.roomNotificationSettings = createStore_forRoomNotificationSettings(
918
+ this.roomSubscriptionSettings = createStore_forRoomSubscriptionSettings(
865
919
  this.optimisticUpdates.signal
866
920
  );
867
921
  this.historyVersions = createStore_forHistoryVersions();
@@ -880,6 +934,14 @@ var UmbrellaStore = class {
880
934
  }),
881
935
  shallow3
882
936
  );
937
+ const threadSubscriptions = DerivedSignal.from(
938
+ notifications,
939
+ this.subscriptions.signal,
940
+ (n, s) => ({
941
+ subscriptions: s,
942
+ notifications: n.sortedNotifications
943
+ })
944
+ );
883
945
  const loadingUserThreads = new DefaultMap(
884
946
  (queryKey) => {
885
947
  const query = JSON.parse(queryKey);
@@ -890,7 +952,8 @@ var UmbrellaStore = class {
890
952
  });
891
953
  this.updateThreadifications(
892
954
  result.threads,
893
- result.inboxNotifications
955
+ result.inboxNotifications,
956
+ result.subscriptions
894
957
  );
895
958
  this.permissionHints.update(result.permissionHints);
896
959
  if (this.#userThreadsLastRequestedAt === null) {
@@ -933,7 +996,8 @@ var UmbrellaStore = class {
933
996
  });
934
997
  this.updateThreadifications(
935
998
  result.threads,
936
- result.inboxNotifications
999
+ result.inboxNotifications,
1000
+ result.subscriptions
937
1001
  );
938
1002
  this.permissionHints.update(result.permissionHints);
939
1003
  const lastRequestedAt = this.#roomThreadsLastRequestedAtByRoom.get(roomId);
@@ -983,28 +1047,30 @@ var UmbrellaStore = class {
983
1047
  }),
984
1048
  waitUntilLoaded: this.#notificationsPaginationState.waitUntilLoaded
985
1049
  };
986
- const settingsByRoomId = new DefaultMap((roomId) => {
987
- const resource = new SinglePageResource(async () => {
988
- const room = this.#client.getRoom(roomId);
989
- if (room === null) {
990
- throw new Error(`Room '${roomId}' is not available on client`);
991
- }
992
- const result = await room.getNotificationSettings();
993
- this.roomNotificationSettings.update(roomId, result);
994
- });
995
- const signal = DerivedSignal.from(() => {
996
- const result = resource.get();
997
- if (result.isLoading || result.error) {
998
- return result;
999
- } else {
1000
- return ASYNC_OK(
1001
- "settings",
1002
- nn(this.roomNotificationSettings.signal.get()[roomId])
1003
- );
1004
- }
1005
- }, shallow3);
1006
- return { signal, waitUntilLoaded: resource.waitUntilLoaded };
1007
- });
1050
+ const roomSubscriptionSettingsByRoomId = new DefaultMap(
1051
+ (roomId) => {
1052
+ const resource = new SinglePageResource(async () => {
1053
+ const room = this.#client.getRoom(roomId);
1054
+ if (room === null) {
1055
+ throw new Error(`Room '${roomId}' is not available on client`);
1056
+ }
1057
+ const result = await room.getSubscriptionSettings();
1058
+ this.roomSubscriptionSettings.update(roomId, result);
1059
+ });
1060
+ const signal = DerivedSignal.from(() => {
1061
+ const result = resource.get();
1062
+ if (result.isLoading || result.error) {
1063
+ return result;
1064
+ } else {
1065
+ return ASYNC_OK(
1066
+ "settings",
1067
+ nn(this.roomSubscriptionSettings.signal.get()[roomId])
1068
+ );
1069
+ }
1070
+ }, shallow3);
1071
+ return { signal, waitUntilLoaded: resource.waitUntilLoaded };
1072
+ }
1073
+ );
1008
1074
  const versionsByRoomId = new DefaultMap(
1009
1075
  (roomId) => {
1010
1076
  const resource = new SinglePageResource(async () => {
@@ -1036,18 +1102,18 @@ var UmbrellaStore = class {
1036
1102
  return { signal, waitUntilLoaded: resource.waitUntilLoaded };
1037
1103
  }
1038
1104
  );
1039
- const userNotificationSettings = {
1105
+ const notificationSettings = {
1040
1106
  signal: DerivedSignal.from(() => {
1041
- const result = this.#userNotificationSettings.get();
1107
+ const result = this.#notificationSettings.get();
1042
1108
  if (result.isLoading || result.error) {
1043
1109
  return result;
1044
1110
  }
1045
1111
  return ASYNC_OK(
1046
1112
  "settings",
1047
- nn(this.userNotificationSettings.signal.get())
1113
+ nn(this.notificationSettings.signal.get())
1048
1114
  );
1049
1115
  }, shallow3),
1050
- waitUntilLoaded: this.#userNotificationSettings.waitUntilLoaded
1116
+ waitUntilLoaded: this.#notificationSettings.waitUntilLoaded
1051
1117
  };
1052
1118
  this.outputs = {
1053
1119
  threadifications,
@@ -1056,9 +1122,10 @@ var UmbrellaStore = class {
1056
1122
  loadingUserThreads,
1057
1123
  notifications,
1058
1124
  loadingNotifications,
1059
- settingsByRoomId,
1125
+ roomSubscriptionSettingsByRoomId,
1060
1126
  versionsByRoomId,
1061
- userNotificationSettings
1127
+ notificationSettings,
1128
+ threadSubscriptions
1062
1129
  };
1063
1130
  autobind(this);
1064
1131
  }
@@ -1100,6 +1167,26 @@ var UmbrellaStore = class {
1100
1167
  this.notifications.clear();
1101
1168
  });
1102
1169
  }
1170
+ /**
1171
+ * Creates a existing subscription, replacing the corresponding
1172
+ * optimistic update.
1173
+ */
1174
+ createSubscription(subscription, optimisticId) {
1175
+ batch2(() => {
1176
+ this.optimisticUpdates.remove(optimisticId);
1177
+ this.subscriptions.create(subscription);
1178
+ });
1179
+ }
1180
+ /**
1181
+ * Deletes an existing subscription, replacing the corresponding
1182
+ * optimistic update.
1183
+ */
1184
+ deleteSubscription(subscriptionKey, optimisticId) {
1185
+ batch2(() => {
1186
+ this.optimisticUpdates.remove(optimisticId);
1187
+ this.subscriptions.delete(subscriptionKey);
1188
+ });
1189
+ }
1103
1190
  /**
1104
1191
  * Creates an new thread, replacing the corresponding optimistic update.
1105
1192
  */
@@ -1201,20 +1288,21 @@ var UmbrellaStore = class {
1201
1288
  deletedAt
1202
1289
  );
1203
1290
  }
1204
- updateThreadifications(threads, notifications, deletedThreads = [], deletedNotifications = []) {
1291
+ updateThreadifications(threads, notifications, subscriptions, deletedThreads = [], deletedNotifications = [], deletedSubscriptions = []) {
1205
1292
  batch2(() => {
1206
1293
  this.threads.applyDelta(threads, deletedThreads);
1207
1294
  this.notifications.applyDelta(notifications, deletedNotifications);
1295
+ this.subscriptions.applyDelta(subscriptions, deletedSubscriptions);
1208
1296
  });
1209
1297
  }
1210
1298
  /**
1211
- * Updates existing notification setting for a room with a new value,
1299
+ * Updates existing subscription settings for a room with a new value,
1212
1300
  * replacing the corresponding optimistic update.
1213
1301
  */
1214
- updateRoomNotificationSettings(roomId, optimisticId, settings) {
1302
+ updateRoomSubscriptionSettings(roomId, optimisticId, settings) {
1215
1303
  batch2(() => {
1216
1304
  this.optimisticUpdates.remove(optimisticId);
1217
- this.roomNotificationSettings.update(roomId, settings);
1305
+ this.roomSubscriptionSettings.update(roomId, settings);
1218
1306
  });
1219
1307
  }
1220
1308
  async fetchNotificationsDeltaUpdate(signal) {
@@ -1232,8 +1320,10 @@ var UmbrellaStore = class {
1232
1320
  this.updateThreadifications(
1233
1321
  result.threads.updated,
1234
1322
  result.inboxNotifications.updated,
1323
+ result.subscriptions.updated,
1235
1324
  result.threads.deleted,
1236
- result.inboxNotifications.deleted
1325
+ result.inboxNotifications.deleted,
1326
+ result.subscriptions.deleted
1237
1327
  );
1238
1328
  }
1239
1329
  async fetchRoomThreadsDeltaUpdate(roomId, signal) {
@@ -1249,8 +1339,10 @@ var UmbrellaStore = class {
1249
1339
  this.updateThreadifications(
1250
1340
  updates.threads.updated,
1251
1341
  updates.inboxNotifications.updated,
1342
+ updates.subscriptions.updated,
1252
1343
  updates.threads.deleted,
1253
- updates.inboxNotifications.deleted
1344
+ updates.inboxNotifications.deleted,
1345
+ updates.subscriptions.deleted
1254
1346
  );
1255
1347
  this.permissionHints.update(updates.permissionHints);
1256
1348
  if (lastRequestedAt < updates.requestedAt) {
@@ -1272,8 +1364,10 @@ var UmbrellaStore = class {
1272
1364
  this.updateThreadifications(
1273
1365
  result.threads.updated,
1274
1366
  result.inboxNotifications.updated,
1367
+ result.subscriptions.updated,
1275
1368
  result.threads.deleted,
1276
- result.inboxNotifications.deleted
1369
+ result.inboxNotifications.deleted,
1370
+ result.subscriptions.deleted
1277
1371
  );
1278
1372
  this.permissionHints.update(result.permissionHints);
1279
1373
  }
@@ -1295,31 +1389,31 @@ var UmbrellaStore = class {
1295
1389
  this.#roomVersionsLastRequestedAtByRoom.set(roomId, updates.requestedAt);
1296
1390
  }
1297
1391
  }
1298
- async refreshRoomNotificationSettings(roomId, signal) {
1392
+ async refreshRoomSubscriptionSettings(roomId, signal) {
1299
1393
  const room = nn(
1300
1394
  this.#client.getRoom(roomId),
1301
1395
  `Room with id ${roomId} is not available on client`
1302
1396
  );
1303
- const result = await room.getNotificationSettings({ signal });
1304
- this.roomNotificationSettings.update(roomId, result);
1397
+ const result = await room.getSubscriptionSettings({ signal });
1398
+ this.roomSubscriptionSettings.update(roomId, result);
1305
1399
  }
1306
1400
  /**
1307
- * Refresh User Notification Settings from poller
1401
+ * Refresh notification settings from poller
1308
1402
  */
1309
- async refreshUserNotificationSettings(signal) {
1403
+ async refreshNotificationSettings(signal) {
1310
1404
  const result = await this.#client.getNotificationSettings({
1311
1405
  signal
1312
1406
  });
1313
- this.userNotificationSettings.update(result);
1407
+ this.notificationSettings.update(result);
1314
1408
  }
1315
1409
  /**
1316
- * Updates user notification settings with a new value, replacing the
1410
+ * Updates notification settings with a new value, replacing the
1317
1411
  * corresponding optimistic update.
1318
1412
  */
1319
- updateUserNotificationSettings_confirmOptimisticUpdate(settings, optimisticUpdateId) {
1413
+ updateNotificationSettings_confirmOptimisticUpdate(settings, optimisticUpdateId) {
1320
1414
  batch2(() => {
1321
1415
  this.optimisticUpdates.remove(optimisticUpdateId);
1322
- this.userNotificationSettings.update(settings);
1416
+ this.notificationSettings.update(settings);
1323
1417
  });
1324
1418
  }
1325
1419
  };
@@ -1478,29 +1572,80 @@ function applyOptimisticUpdates_forThreadifications(baseThreadsDB, notifications
1478
1572
  threadsDB
1479
1573
  };
1480
1574
  }
1481
- function applyOptimisticUpdates_forSettings(settingsLUT, optimisticUpdates) {
1482
- const settingsByRoomId = Object.fromEntries(settingsLUT);
1575
+ function applyOptimisticUpdates_forRoomSubscriptionSettings(settingsLUT, optimisticUpdates) {
1576
+ const roomSubscriptionSettingsByRoomId = Object.fromEntries(settingsLUT);
1483
1577
  for (const optimisticUpdate of optimisticUpdates) {
1484
1578
  switch (optimisticUpdate.type) {
1485
- case "update-notification-settings": {
1486
- const settings = settingsByRoomId[optimisticUpdate.roomId];
1579
+ case "update-room-subscription-settings": {
1580
+ const settings = roomSubscriptionSettingsByRoomId[optimisticUpdate.roomId];
1487
1581
  if (settings === void 0) {
1488
1582
  break;
1489
1583
  }
1490
- settingsByRoomId[optimisticUpdate.roomId] = {
1584
+ roomSubscriptionSettingsByRoomId[optimisticUpdate.roomId] = {
1491
1585
  ...settings,
1492
1586
  ...optimisticUpdate.settings
1493
1587
  };
1494
1588
  }
1495
1589
  }
1496
1590
  }
1497
- return settingsByRoomId;
1591
+ return roomSubscriptionSettingsByRoomId;
1498
1592
  }
1499
- function applyOptimisticUpdates_forUserNotificationSettings(settings, optimisticUpdates) {
1593
+ function applyOptimisticUpdates_forSubscriptions(subscriptionsLUT, threads, optimisticUpdates) {
1594
+ const subscriptions = Object.fromEntries(subscriptionsLUT);
1595
+ for (const update of optimisticUpdates) {
1596
+ if (update.type === "update-room-subscription-settings") {
1597
+ if (update.settings.threads) {
1598
+ const roomThreads = threads.findMany(update.roomId, void 0, "desc");
1599
+ for (const thread of roomThreads) {
1600
+ const subscriptionKey = getSubscriptionKey("thread", thread.id);
1601
+ if (update.settings.threads === "all") {
1602
+ subscriptions[subscriptionKey] = {
1603
+ kind: "thread",
1604
+ subjectId: thread.id,
1605
+ createdAt: /* @__PURE__ */ new Date()
1606
+ };
1607
+ } else if (update.settings.threads === "none") {
1608
+ delete subscriptions[subscriptionKey];
1609
+ } else if (update.settings.threads === "replies_and_mentions") {
1610
+ let isParticipant = false;
1611
+ for (const comment of thread.comments) {
1612
+ if (comment.deletedAt) {
1613
+ continue;
1614
+ }
1615
+ if (comment.userId === update.userId) {
1616
+ isParticipant = true;
1617
+ break;
1618
+ }
1619
+ const mentionedIds = getMentionedIdsFromCommentBody(comment.body);
1620
+ if (mentionedIds.includes(update.userId)) {
1621
+ isParticipant = true;
1622
+ break;
1623
+ }
1624
+ }
1625
+ if (isParticipant && !subscriptions[subscriptionKey]) {
1626
+ subscriptions[subscriptionKey] = {
1627
+ kind: "thread",
1628
+ subjectId: thread.id,
1629
+ createdAt: /* @__PURE__ */ new Date()
1630
+ };
1631
+ }
1632
+ } else {
1633
+ assertNever(
1634
+ update.settings.threads,
1635
+ "Unexpected room subscription settings."
1636
+ );
1637
+ }
1638
+ }
1639
+ }
1640
+ }
1641
+ }
1642
+ return subscriptions;
1643
+ }
1644
+ function applyOptimisticUpdates_forNotificationSettings(settings, optimisticUpdates) {
1500
1645
  let outcoming = settings;
1501
1646
  for (const update of optimisticUpdates) {
1502
- if (update.type === "update-user-notification-settings") {
1503
- outcoming = patchUserNotificationSettings(outcoming, update.settings);
1647
+ if (update.type === "update-notification-settings") {
1648
+ outcoming = patchNotificationSettings(outcoming, update.settings);
1504
1649
  }
1505
1650
  }
1506
1651
  return outcoming;
@@ -1798,13 +1943,13 @@ function makeLiveblocksExtrasForClient(client) {
1798
1943
  config.USER_THREADS_POLL_INTERVAL,
1799
1944
  { maxStaleTimeMs: config.USER_THREADS_MAX_STALE_TIME }
1800
1945
  );
1801
- const userNotificationSettingsPoller = makePoller(
1946
+ const notificationSettingsPoller = makePoller(
1802
1947
  async (signal) => {
1803
1948
  try {
1804
- return await store.refreshUserNotificationSettings(signal);
1949
+ return await store.refreshNotificationSettings(signal);
1805
1950
  } catch (err) {
1806
1951
  console.warn(
1807
- `Polling new user notification settings failed: ${String(err)}`
1952
+ `Polling new notification settings failed: ${String(err)}`
1808
1953
  );
1809
1954
  throw err;
1810
1955
  }
@@ -1816,7 +1961,7 @@ function makeLiveblocksExtrasForClient(client) {
1816
1961
  store,
1817
1962
  notificationsPoller,
1818
1963
  userThreadsPoller,
1819
- userNotificationSettingsPoller
1964
+ notificationSettingsPoller
1820
1965
  };
1821
1966
  }
1822
1967
  function makeLiveblocksContextBundle(client) {
@@ -2044,12 +2189,12 @@ function useUpdateNotificationSettings_withClient(client) {
2044
2189
  (settings) => {
2045
2190
  const { store } = getLiveblocksExtrasForClient(client);
2046
2191
  const optimisticUpdateId = store.optimisticUpdates.add({
2047
- type: "update-user-notification-settings",
2192
+ type: "update-notification-settings",
2048
2193
  settings
2049
2194
  });
2050
2195
  client.updateNotificationSettings(settings).then(
2051
2196
  (settings2) => {
2052
- store.updateUserNotificationSettings_confirmOptimisticUpdate(
2197
+ store.updateNotificationSettings_confirmOptimisticUpdate(
2053
2198
  settings2,
2054
2199
  optimisticUpdateId
2055
2200
  );
@@ -2078,9 +2223,9 @@ function useUpdateNotificationSettings_withClient(client) {
2078
2223
  }
2079
2224
  function useNotificationSettings_withClient(client) {
2080
2225
  const updateNotificationSettings = useUpdateNotificationSettings_withClient(client);
2081
- const { store, userNotificationSettingsPoller: poller } = getLiveblocksExtrasForClient(client);
2226
+ const { store, notificationSettingsPoller: poller } = getLiveblocksExtrasForClient(client);
2082
2227
  useEffect3(() => {
2083
- void store.outputs.userNotificationSettings.waitUntilLoaded();
2228
+ void store.outputs.notificationSettings.waitUntilLoaded();
2084
2229
  });
2085
2230
  useEffect3(() => {
2086
2231
  poller.inc();
@@ -2089,7 +2234,7 @@ function useNotificationSettings_withClient(client) {
2089
2234
  poller.dec();
2090
2235
  };
2091
2236
  }, [poller]);
2092
- const result = useSignal(store.outputs.userNotificationSettings.signal);
2237
+ const result = useSignal(store.outputs.notificationSettings.signal);
2093
2238
  return useMemo2(() => {
2094
2239
  return [result, updateNotificationSettings];
2095
2240
  }, [result, updateNotificationSettings]);
@@ -2097,7 +2242,7 @@ function useNotificationSettings_withClient(client) {
2097
2242
  function useNotificationSettingsSuspense_withClient(client) {
2098
2243
  ensureNotServerSide();
2099
2244
  const store = getLiveblocksExtrasForClient(client).store;
2100
- use(store.outputs.userNotificationSettings.waitUntilLoaded());
2245
+ use(store.outputs.notificationSettings.waitUntilLoaded());
2101
2246
  const [result, updateNotificationSettings] = useNotificationSettings_withClient(client);
2102
2247
  assert(!result.error, "Did not expect error");
2103
2248
  assert(!result.isLoading, "Did not expect loading");
@@ -2456,6 +2601,7 @@ import {
2456
2601
  createThreadId,
2457
2602
  DefaultMap as DefaultMap2,
2458
2603
  errorIf,
2604
+ getSubscriptionKey as getSubscriptionKey2,
2459
2605
  HttpError as HttpError2,
2460
2606
  kInternal as kInternal3,
2461
2607
  makePoller as makePoller2,
@@ -2615,29 +2761,36 @@ function makeRoomExtrasForClient(client) {
2615
2761
  { maxStaleTimeMs: config.HISTORY_VERSIONS_MAX_STALE_TIME }
2616
2762
  )
2617
2763
  );
2618
- const roomNotificationSettingsPollersByRoomId = new DefaultMap2(
2764
+ const roomSubscriptionSettingsPollersByRoomId = new DefaultMap2(
2619
2765
  (roomId) => makePoller2(
2620
2766
  async (signal) => {
2621
2767
  try {
2622
- return await store.refreshRoomNotificationSettings(roomId, signal);
2768
+ return await store.refreshRoomSubscriptionSettings(roomId, signal);
2623
2769
  } catch (err) {
2624
- console3.warn(`Polling notification settings for '${roomId}' failed: ${String(err)}`);
2770
+ console3.warn(`Polling subscription settings for '${roomId}' failed: ${String(err)}`);
2625
2771
  throw err;
2626
2772
  }
2627
2773
  },
2628
- config.NOTIFICATION_SETTINGS_POLL_INTERVAL,
2629
- { maxStaleTimeMs: config.NOTIFICATION_SETTINGS_MAX_STALE_TIME }
2774
+ config.ROOM_SUBSCRIPTION_SETTINGS_POLL_INTERVAL,
2775
+ { maxStaleTimeMs: config.ROOM_SUBSCRIPTION_SETTINGS_MAX_STALE_TIME }
2630
2776
  )
2631
2777
  );
2632
2778
  return {
2633
2779
  store,
2634
2780
  onMutationFailure,
2781
+ pollThreadsForRoomId: (roomId) => {
2782
+ const threadsPoller = threadsPollersByRoomId.getOrCreate(roomId);
2783
+ if (threadsPoller) {
2784
+ threadsPoller.markAsStale();
2785
+ threadsPoller.pollNowIfStale();
2786
+ }
2787
+ },
2635
2788
  getOrCreateThreadsPollerForRoomId: threadsPollersByRoomId.getOrCreate.bind(
2636
2789
  threadsPollersByRoomId
2637
2790
  ),
2638
2791
  getOrCreateVersionsPollerForRoomId: versionsPollersByRoomId.getOrCreate.bind(versionsPollersByRoomId),
2639
- getOrCreateNotificationsSettingsPollerForRoomId: roomNotificationSettingsPollersByRoomId.getOrCreate.bind(
2640
- roomNotificationSettingsPollersByRoomId
2792
+ getOrCreateSubscriptionSettingsPollerForRoomId: roomSubscriptionSettingsPollersByRoomId.getOrCreate.bind(
2793
+ roomSubscriptionSettingsPollersByRoomId
2641
2794
  )
2642
2795
  };
2643
2796
  }
@@ -2678,6 +2831,8 @@ function makeRoomContextBundle(client) {
2678
2831
  useEditThreadMetadata,
2679
2832
  useMarkThreadAsResolved,
2680
2833
  useMarkThreadAsUnresolved,
2834
+ useSubscribeToThread,
2835
+ useUnsubscribeFromThread,
2681
2836
  useCreateComment,
2682
2837
  useEditComment,
2683
2838
  useDeleteComment,
@@ -2689,7 +2844,9 @@ function makeRoomContextBundle(client) {
2689
2844
  useHistoryVersions,
2690
2845
  useHistoryVersionData,
2691
2846
  useRoomNotificationSettings,
2847
+ useRoomSubscriptionSettings,
2692
2848
  useUpdateRoomNotificationSettings,
2849
+ useUpdateRoomSubscriptionSettings,
2693
2850
  ...shared.classic,
2694
2851
  suspense: {
2695
2852
  RoomContext,
@@ -2723,6 +2880,8 @@ function makeRoomContextBundle(client) {
2723
2880
  useEditThreadMetadata,
2724
2881
  useMarkThreadAsResolved,
2725
2882
  useMarkThreadAsUnresolved,
2883
+ useSubscribeToThread,
2884
+ useUnsubscribeFromThread,
2726
2885
  useCreateComment,
2727
2886
  useEditComment,
2728
2887
  useDeleteComment,
@@ -2734,7 +2893,9 @@ function makeRoomContextBundle(client) {
2734
2893
  // TODO: useHistoryVersionData: useHistoryVersionDataSuspense,
2735
2894
  useHistoryVersions: useHistoryVersionsSuspense,
2736
2895
  useRoomNotificationSettings: useRoomNotificationSettingsSuspense,
2896
+ useRoomSubscriptionSettings: useRoomSubscriptionSettingsSuspense,
2737
2897
  useUpdateRoomNotificationSettings,
2898
+ useUpdateRoomSubscriptionSettings,
2738
2899
  ...shared.suspense
2739
2900
  }
2740
2901
  };
@@ -2813,7 +2974,11 @@ function RoomProviderInner(props) {
2813
2974
  store.deleteThread(message.threadId, null);
2814
2975
  return;
2815
2976
  }
2816
- const { thread, inboxNotification: maybeNotification } = info;
2977
+ const {
2978
+ thread,
2979
+ inboxNotification: maybeNotification,
2980
+ subscription: maybeSubscription
2981
+ } = info;
2817
2982
  const existingThread = store.outputs.threads.get().getEvenIfDeleted(message.threadId);
2818
2983
  switch (message.type) {
2819
2984
  case ServerMsgCode.COMMENT_EDITED:
@@ -2825,13 +2990,15 @@ function RoomProviderInner(props) {
2825
2990
  if (!existingThread) break;
2826
2991
  store.updateThreadifications(
2827
2992
  [thread],
2828
- maybeNotification ? [maybeNotification] : []
2993
+ maybeNotification ? [maybeNotification] : [],
2994
+ maybeSubscription ? [maybeSubscription] : []
2829
2995
  );
2830
2996
  break;
2831
2997
  case ServerMsgCode.COMMENT_CREATED:
2832
2998
  store.updateThreadifications(
2833
2999
  [thread],
2834
- maybeNotification ? [maybeNotification] : []
3000
+ maybeNotification ? [maybeNotification] : [],
3001
+ maybeSubscription ? [maybeSubscription] : []
2835
3002
  );
2836
3003
  break;
2837
3004
  default:
@@ -3680,25 +3847,103 @@ function useMarkRoomThreadAsUnresolved(roomId) {
3680
3847
  [client, roomId]
3681
3848
  );
3682
3849
  }
3850
+ function useSubscribeToThread() {
3851
+ return useSubscribeToRoomThread(useRoom().id);
3852
+ }
3853
+ function useSubscribeToRoomThread(roomId) {
3854
+ const client = useClient();
3855
+ return useCallback3(
3856
+ (threadId) => {
3857
+ const subscribedAt = /* @__PURE__ */ new Date();
3858
+ const { store, onMutationFailure } = getRoomExtrasForClient(client);
3859
+ const optimisticId = store.optimisticUpdates.add({
3860
+ type: "subscribe-to-thread",
3861
+ threadId,
3862
+ subscribedAt
3863
+ });
3864
+ client[kInternal3].httpClient.subscribeToThread({ roomId, threadId }).then(
3865
+ (subscription) => {
3866
+ store.createSubscription(subscription, optimisticId);
3867
+ },
3868
+ (err) => onMutationFailure(
3869
+ optimisticId,
3870
+ { type: "SUBSCRIBE_TO_THREAD_ERROR", roomId, threadId },
3871
+ err
3872
+ )
3873
+ );
3874
+ },
3875
+ [client, roomId]
3876
+ );
3877
+ }
3878
+ function useUnsubscribeFromThread() {
3879
+ return useUnsubscribeFromRoomThread(useRoom().id);
3880
+ }
3881
+ function useUnsubscribeFromRoomThread(roomId) {
3882
+ const client = useClient();
3883
+ return useCallback3(
3884
+ (threadId) => {
3885
+ const unsubscribedAt = /* @__PURE__ */ new Date();
3886
+ const { store, onMutationFailure } = getRoomExtrasForClient(client);
3887
+ const optimisticId = store.optimisticUpdates.add({
3888
+ type: "unsubscribe-from-thread",
3889
+ threadId,
3890
+ unsubscribedAt
3891
+ });
3892
+ client[kInternal3].httpClient.unsubscribeFromThread({ roomId, threadId }).then(
3893
+ () => {
3894
+ store.deleteSubscription(
3895
+ getSubscriptionKey2("thread", threadId),
3896
+ optimisticId
3897
+ );
3898
+ },
3899
+ (err) => onMutationFailure(
3900
+ optimisticId,
3901
+ { type: "UNSUBSCRIBE_FROM_THREAD_ERROR", roomId, threadId },
3902
+ err
3903
+ )
3904
+ );
3905
+ },
3906
+ [client, roomId]
3907
+ );
3908
+ }
3683
3909
  function useThreadSubscription(threadId) {
3910
+ return useRoomThreadSubscription(useRoom().id, threadId);
3911
+ }
3912
+ function useRoomThreadSubscription(roomId, threadId) {
3684
3913
  const client = useClient();
3685
3914
  const { store } = getRoomExtrasForClient(client);
3686
- const signal = store.outputs.threadifications;
3915
+ const subscriptionKey = useMemo3(
3916
+ () => getSubscriptionKey2("thread", threadId),
3917
+ [threadId]
3918
+ );
3919
+ const subscribeToThread = useSubscribeToRoomThread(roomId);
3920
+ const unsubscribeFromThread = useUnsubscribeFromRoomThread(roomId);
3921
+ const subscribe = useCallback3(
3922
+ () => subscribeToThread(threadId),
3923
+ [subscribeToThread, threadId]
3924
+ );
3925
+ const unsubscribe = useCallback3(
3926
+ () => unsubscribeFromThread(threadId),
3927
+ [unsubscribeFromThread, threadId]
3928
+ );
3929
+ const signal = store.outputs.threadSubscriptions;
3687
3930
  const selector = useCallback3(
3688
3931
  (state) => {
3689
- const notification = state.sortedNotifications.find(
3932
+ const subscription = state.subscriptions[subscriptionKey];
3933
+ const notification = state.notifications.find(
3690
3934
  (inboxNotification) => inboxNotification.kind === "thread" && inboxNotification.threadId === threadId
3691
3935
  );
3692
- const thread = state.threadsDB.get(threadId);
3693
- if (notification === void 0 || thread === void 0) {
3694
- return { status: "not-subscribed" };
3936
+ if (subscription === void 0) {
3937
+ return { status: "not-subscribed", subscribe, unsubscribe };
3695
3938
  }
3696
3939
  return {
3697
3940
  status: "subscribed",
3698
- unreadSince: notification.readAt
3941
+ unreadSince: notification?.readAt ?? null,
3942
+ subscribe,
3943
+ unsubscribe
3699
3944
  };
3700
3945
  },
3701
- [threadId]
3946
+ [subscriptionKey, threadId, subscribe, unsubscribe]
3702
3947
  );
3703
3948
  return useSignal(signal, selector, shallow5);
3704
3949
  }
@@ -3706,10 +3951,10 @@ function useRoomNotificationSettings() {
3706
3951
  const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
3707
3952
  const client = useClient();
3708
3953
  const room = useRoom();
3709
- const { store, getOrCreateNotificationsSettingsPollerForRoomId } = getRoomExtrasForClient(client);
3710
- const poller = getOrCreateNotificationsSettingsPollerForRoomId(room.id);
3954
+ const { store, getOrCreateSubscriptionSettingsPollerForRoomId } = getRoomExtrasForClient(client);
3955
+ const poller = getOrCreateSubscriptionSettingsPollerForRoomId(room.id);
3711
3956
  useEffect5(
3712
- () => void store.outputs.settingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
3957
+ () => void store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
3713
3958
  // NOTE: Deliberately *not* using a dependency array here!
3714
3959
  //
3715
3960
  // It is important to call waitUntil on *every* render.
@@ -3727,18 +3972,51 @@ function useRoomNotificationSettings() {
3727
3972
  };
3728
3973
  }, [poller]);
3729
3974
  const settings = useSignal(
3730
- store.outputs.settingsByRoomId.getOrCreate(room.id).signal
3975
+ store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).signal
3731
3976
  );
3732
3977
  return useMemo3(() => {
3733
3978
  return [settings, updateRoomNotificationSettings];
3734
3979
  }, [settings, updateRoomNotificationSettings]);
3735
3980
  }
3981
+ function useRoomSubscriptionSettings() {
3982
+ const updateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings();
3983
+ const client = useClient();
3984
+ const room = useRoom();
3985
+ const { store, getOrCreateSubscriptionSettingsPollerForRoomId } = getRoomExtrasForClient(client);
3986
+ const poller = getOrCreateSubscriptionSettingsPollerForRoomId(room.id);
3987
+ useEffect5(
3988
+ () => void store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
3989
+ // NOTE: Deliberately *not* using a dependency array here!
3990
+ //
3991
+ // It is important to call waitUntil on *every* render.
3992
+ // This is harmless though, on most renders, except:
3993
+ // 1. The very first render, in which case we'll want to trigger the initial page fetch.
3994
+ // 2. All other subsequent renders now "just" return the same promise (a quick operation).
3995
+ // 3. If ever the promise would fail, then after 5 seconds it would reset, and on the very
3996
+ // *next* render after that, a *new* fetch/promise will get created.
3997
+ );
3998
+ useEffect5(() => {
3999
+ poller.inc();
4000
+ poller.pollNowIfStale();
4001
+ return () => {
4002
+ poller.dec();
4003
+ };
4004
+ }, [poller]);
4005
+ const settings = useSignal(
4006
+ store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).signal
4007
+ );
4008
+ return useMemo3(() => {
4009
+ return [settings, updateRoomSubscriptionSettings];
4010
+ }, [settings, updateRoomSubscriptionSettings]);
4011
+ }
3736
4012
  function useRoomNotificationSettingsSuspense() {
3737
4013
  ensureNotServerSide();
3738
4014
  const client = useClient();
3739
4015
  const store = getRoomExtrasForClient(client).store;
3740
4016
  const room = useRoom();
3741
- use(store.outputs.settingsByRoomId.getOrCreate(room.id).waitUntilLoaded());
4017
+ use(
4018
+ store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
4019
+ );
3742
4020
  const [settings, updateRoomNotificationSettings] = useRoomNotificationSettings();
3743
4021
  assert2(!settings.error, "Did not expect error");
3744
4022
  assert2(!settings.isLoading, "Did not expect loading");
@@ -3746,6 +4024,21 @@ function useRoomNotificationSettingsSuspense() {
3746
4024
  return [settings, updateRoomNotificationSettings];
3747
4025
  }, [settings, updateRoomNotificationSettings]);
3748
4026
  }
4027
+ function useRoomSubscriptionSettingsSuspense() {
4028
+ ensureNotServerSide();
4029
+ const client = useClient();
4030
+ const store = getRoomExtrasForClient(client).store;
4031
+ const room = useRoom();
4032
+ use(
4033
+ store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
4034
+ );
4035
+ const [settings, updateRoomSubscriptionSettings] = useRoomSubscriptionSettings();
4036
+ assert2(!settings.error, "Did not expect error");
4037
+ assert2(!settings.isLoading, "Did not expect loading");
4038
+ return useMemo3(() => {
4039
+ return [settings, updateRoomSubscriptionSettings];
4040
+ }, [settings, updateRoomSubscriptionSettings]);
4041
+ }
3749
4042
  function useHistoryVersionData(versionId) {
3750
4043
  const [state, setState] = useState2({
3751
4044
  isLoading: true
@@ -3814,15 +4107,24 @@ function useUpdateRoomNotificationSettings() {
3814
4107
  const room = useRoom();
3815
4108
  return useCallback3(
3816
4109
  (settings) => {
3817
- const { store, onMutationFailure } = getRoomExtrasForClient(client);
4110
+ const { store, onMutationFailure, pollThreadsForRoomId } = getRoomExtrasForClient(client);
4111
+ const userId = getCurrentUserId(client);
3818
4112
  const optimisticId = store.optimisticUpdates.add({
3819
- type: "update-notification-settings",
4113
+ type: "update-room-subscription-settings",
3820
4114
  roomId: room.id,
4115
+ userId,
3821
4116
  settings
3822
4117
  });
3823
- room.updateNotificationSettings(settings).then(
3824
- (settings2) => {
3825
- store.updateRoomNotificationSettings(room.id, optimisticId, settings2);
4118
+ room.updateSubscriptionSettings(settings).then(
4119
+ (updatedSettings) => {
4120
+ store.updateRoomSubscriptionSettings(
4121
+ room.id,
4122
+ optimisticId,
4123
+ updatedSettings
4124
+ );
4125
+ if (settings.threads) {
4126
+ pollThreadsForRoomId(room.id);
4127
+ }
3826
4128
  },
3827
4129
  (err) => onMutationFailure(
3828
4130
  optimisticId,
@@ -3834,6 +4136,43 @@ function useUpdateRoomNotificationSettings() {
3834
4136
  [client, room]
3835
4137
  );
3836
4138
  }
4139
+ function useUpdateRoomSubscriptionSettings() {
4140
+ const client = useClient();
4141
+ const room = useRoom();
4142
+ return useCallback3(
4143
+ (settings) => {
4144
+ const { store, onMutationFailure, pollThreadsForRoomId } = getRoomExtrasForClient(client);
4145
+ const userId = getCurrentUserId(client);
4146
+ const optimisticId = store.optimisticUpdates.add({
4147
+ type: "update-room-subscription-settings",
4148
+ roomId: room.id,
4149
+ userId,
4150
+ settings
4151
+ });
4152
+ room.updateSubscriptionSettings(settings).then(
4153
+ (udpatedSettings) => {
4154
+ store.updateRoomSubscriptionSettings(
4155
+ room.id,
4156
+ optimisticId,
4157
+ udpatedSettings
4158
+ );
4159
+ if (settings.threads) {
4160
+ pollThreadsForRoomId(room.id);
4161
+ }
4162
+ },
4163
+ (err) => onMutationFailure(
4164
+ optimisticId,
4165
+ {
4166
+ type: "UPDATE_ROOM_SUBSCRIPTION_SETTINGS_ERROR",
4167
+ roomId: room.id
4168
+ },
4169
+ err
4170
+ )
4171
+ );
4172
+ },
4173
+ [client, room]
4174
+ );
4175
+ }
3837
4176
  function useSuspendUntilPresenceReady() {
3838
4177
  ensureNotServerSide();
3839
4178
  const room = useRoom();
@@ -3985,7 +4324,9 @@ var _useOthersMappedSuspense = useOthersMappedSuspense;
3985
4324
  var _useThreads = useThreads;
3986
4325
  var _useThreadsSuspense = useThreadsSuspense;
3987
4326
  var _useRoomNotificationSettings = useRoomNotificationSettings;
4327
+ var _useRoomSubscriptionSettings = useRoomSubscriptionSettings;
3988
4328
  var _useRoomNotificationSettingsSuspense = useRoomNotificationSettingsSuspense;
4329
+ var _useRoomSubscriptionSettingsSuspense = useRoomSubscriptionSettingsSuspense;
3989
4330
  var _useHistoryVersions = useHistoryVersions;
3990
4331
  var _useHistoryVersionsSuspense = useHistoryVersionsSuspense;
3991
4332
  var _useOther = useOther;
@@ -4071,9 +4412,13 @@ export {
4071
4412
  useMarkRoomThreadAsResolved,
4072
4413
  useMarkThreadAsUnresolved,
4073
4414
  useMarkRoomThreadAsUnresolved,
4415
+ useSubscribeToThread,
4416
+ useUnsubscribeFromThread,
4074
4417
  useThreadSubscription,
4418
+ useRoomThreadSubscription,
4075
4419
  useHistoryVersionData,
4076
4420
  useUpdateRoomNotificationSettings,
4421
+ useUpdateRoomSubscriptionSettings,
4077
4422
  useOthersConnectionIdsSuspense,
4078
4423
  useStorageStatusSuspense,
4079
4424
  useAttachmentUrl,
@@ -4098,7 +4443,9 @@ export {
4098
4443
  _useThreads,
4099
4444
  _useThreadsSuspense,
4100
4445
  _useRoomNotificationSettings,
4446
+ _useRoomSubscriptionSettings,
4101
4447
  _useRoomNotificationSettingsSuspense,
4448
+ _useRoomSubscriptionSettingsSuspense,
4102
4449
  _useHistoryVersions,
4103
4450
  _useHistoryVersionsSuspense,
4104
4451
  _useOther,
@@ -4112,4 +4459,4 @@ export {
4112
4459
  _useStorageRoot,
4113
4460
  _useUpdateMyPresence
4114
4461
  };
4115
- //# sourceMappingURL=chunk-URVBSXYW.js.map
4462
+ //# sourceMappingURL=chunk-ZWYRZR44.js.map