@stream-io/feeds-client 0.2.15 → 0.2.17

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/react-bindings.js +1 -1
  4. package/dist/es/index.mjs +2 -2
  5. package/dist/es/react-bindings.mjs +1 -1
  6. package/dist/{index-BSzSBlMh.mjs → index-BZL77zNq.mjs} +184 -27
  7. package/dist/index-BZL77zNq.mjs.map +1 -0
  8. package/dist/{index-DRX66SIx.js → index-nq6SDtbt.js} +184 -27
  9. package/dist/index-nq6SDtbt.js.map +1 -0
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts +14 -0
  12. package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts.map +1 -0
  13. package/dist/types/feed/event-handlers/activity/index.d.ts +1 -0
  14. package/dist/types/feed/event-handlers/activity/index.d.ts.map +1 -1
  15. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-added.d.ts.map +1 -1
  16. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts +6 -0
  17. package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts.map +1 -0
  18. package/dist/types/feed/event-handlers/comment/index.d.ts +1 -0
  19. package/dist/types/feed/event-handlers/comment/index.d.ts.map +1 -1
  20. package/dist/types/feed/feed.d.ts.map +1 -1
  21. package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
  22. package/dist/types/gen/feeds/FeedsApi.d.ts +4 -1
  23. package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
  24. package/dist/types/gen/models/index.d.ts +7 -0
  25. package/dist/types/gen/models/index.d.ts.map +1 -1
  26. package/dist/types/utils/state-update-queue.d.ts +5 -1
  27. package/dist/types/utils/state-update-queue.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/feed/event-handlers/activity/handle-activity-reaction-updated.test.ts +282 -0
  30. package/src/feed/event-handlers/activity/handle-activity-reaction-updated.ts +140 -0
  31. package/src/feed/event-handlers/activity/index.ts +1 -0
  32. package/src/feed/event-handlers/comment/handle-comment-reaction-added.ts +1 -2
  33. package/src/feed/event-handlers/comment/handle-comment-reaction-updated.test.ts +350 -0
  34. package/src/feed/event-handlers/comment/handle-comment-reaction-updated.ts +72 -0
  35. package/src/feed/event-handlers/comment/index.ts +1 -1
  36. package/src/feed/feed.ts +4 -2
  37. package/src/feeds-client/feeds-client.ts +15 -3
  38. package/src/gen/feeds/FeedsApi.ts +28 -0
  39. package/src/gen/models/index.ts +10 -0
  40. package/src/test-utils/response-generators.ts +52 -0
  41. package/src/utils/state-update-queue.ts +14 -2
  42. package/dist/index-BSzSBlMh.mjs.map +0 -1
  43. package/dist/index-DRX66SIx.js.map +0 -1
@@ -2402,6 +2402,24 @@ class FeedsApi {
2402
2402
  decoders.CreateFeedsBatchResponse?.(response.body);
2403
2403
  return { ...response.body, metadata: response.metadata };
2404
2404
  }
2405
+ async ownCapabilitiesBatch(request) {
2406
+ const queryParams = {
2407
+ connection_id: request?.connection_id
2408
+ };
2409
+ const body = {
2410
+ feeds: request?.feeds
2411
+ };
2412
+ const response = await this.apiClient.sendRequest(
2413
+ "POST",
2414
+ "/api/v2/feeds/feeds/own_capabilities/batch",
2415
+ void 0,
2416
+ queryParams,
2417
+ body,
2418
+ "application/json"
2419
+ );
2420
+ decoders.OwnCapabilitiesBatchResponse?.(response.body);
2421
+ return { ...response.body, metadata: response.metadata };
2422
+ }
2405
2423
  async _queryFeeds(request) {
2406
2424
  const queryParams = {
2407
2425
  connection_id: request?.connection_id
@@ -3722,7 +3740,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
3722
3740
  };
3723
3741
  return result;
3724
3742
  };
3725
- const version = "0.2.15";
3743
+ const version = "0.2.17";
3726
3744
  class ApiClient {
3727
3745
  constructor(apiKey, tokenManager, connectionIdManager, options) {
3728
3746
  this.apiKey = apiKey;
@@ -4531,14 +4549,16 @@ function getStateUpdateQueueId(...args) {
4531
4549
  return toJoin.concat([data.activity.id]).join("-");
4532
4550
  }
4533
4551
  case "activity-reaction-created":
4534
- case "activity-reaction-deleted": {
4552
+ case "activity-reaction-deleted":
4553
+ case "activity-reaction-updated": {
4535
4554
  return toJoin.concat([
4536
4555
  data.activity.id,
4537
4556
  data.reaction.type
4538
4557
  ]).join("-");
4539
4558
  }
4540
4559
  case "comment-reaction-created":
4541
- case "comment-reaction-deleted": {
4560
+ case "comment-reaction-deleted":
4561
+ case "comment-reaction-updated": {
4542
4562
  return toJoin.concat([
4543
4563
  data.comment.id,
4544
4564
  data.reaction.type
@@ -4898,7 +4918,6 @@ function handleCommentReactionAdded(payload, fromWs) {
4898
4918
  newComments[commentIndex] = {
4899
4919
  ...newComments[commentIndex],
4900
4920
  reaction_count: comment.reaction_count ?? 0,
4901
- // TODO: FIXME this should be handled by the backend
4902
4921
  latest_reactions: comment.latest_reactions ?? [],
4903
4922
  reaction_groups: comment.reaction_groups ?? {},
4904
4923
  own_reactions: ownReactions
@@ -4963,6 +4982,51 @@ function handleCommentReactionDeleted(payload, fromWs) {
4963
4982
  };
4964
4983
  });
4965
4984
  }
4985
+ function handleCommentReactionUpdated(payload, fromWs) {
4986
+ const { comment, reaction } = payload;
4987
+ const connectedUser = this.client.state.getLatestValue().connected_user;
4988
+ const isOwnReaction = reaction.user.id === connectedUser?.id;
4989
+ if (!shouldUpdateState({
4990
+ stateUpdateQueueId: getStateUpdateQueueId(
4991
+ payload,
4992
+ "comment-reaction-updated"
4993
+ ),
4994
+ stateUpdateQueue: this.stateUpdateQueue,
4995
+ watch: this.currentState.watch,
4996
+ fromWs,
4997
+ isTriggeredByConnectedUser: isOwnReaction
4998
+ })) {
4999
+ return;
5000
+ }
5001
+ this.state.next((currentState) => {
5002
+ const commentIndex = this.getCommentIndex(comment, currentState);
5003
+ if (commentIndex === -1) return currentState;
5004
+ const forId = comment.parent_id ?? comment.object_id;
5005
+ const entityState = currentState.comments_by_entity_id[forId];
5006
+ const newComments = entityState?.comments?.concat([]) ?? [];
5007
+ let ownReactions = newComments[commentIndex].own_reactions;
5008
+ if (isOwnReaction) {
5009
+ ownReactions = [reaction];
5010
+ }
5011
+ newComments[commentIndex] = {
5012
+ ...newComments[commentIndex],
5013
+ reaction_count: comment.reaction_count ?? 0,
5014
+ latest_reactions: comment.latest_reactions ?? [],
5015
+ reaction_groups: comment.reaction_groups ?? {},
5016
+ own_reactions: ownReactions
5017
+ };
5018
+ return {
5019
+ ...currentState,
5020
+ comments_by_entity_id: {
5021
+ ...currentState.comments_by_entity_id,
5022
+ [forId]: {
5023
+ ...entityState,
5024
+ comments: newComments
5025
+ }
5026
+ }
5027
+ };
5028
+ });
5029
+ }
4966
5030
  function handleFeedMemberAdded(event) {
4967
5031
  const { connected_user: connectedUser } = this.client.state.getLatestValue();
4968
5032
  this.state.next((currentState) => {
@@ -5026,7 +5090,7 @@ function handleFeedMemberRemoved(event) {
5026
5090
  return newState ?? currentState;
5027
5091
  });
5028
5092
  }
5029
- const sharedUpdateActivity$5 = ({
5093
+ const sharedUpdateActivity$6 = ({
5030
5094
  currentActivity,
5031
5095
  event,
5032
5096
  eventBelongsToCurrentUser
@@ -5044,7 +5108,7 @@ const sharedUpdateActivity$5 = ({
5044
5108
  const addBookmarkToActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5045
5109
  entities: activities,
5046
5110
  matcher: (activity) => activity.id === event.bookmark.activity.id,
5047
- updater: (matchedActivity) => sharedUpdateActivity$5({
5111
+ updater: (matchedActivity) => sharedUpdateActivity$6({
5048
5112
  currentActivity: matchedActivity,
5049
5113
  event,
5050
5114
  eventBelongsToCurrentUser
@@ -5054,7 +5118,7 @@ const addBookmarkToPinnedActivities = (event, pinnedActivities, eventBelongsToCu
5054
5118
  entities: pinnedActivities,
5055
5119
  matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
5056
5120
  updater: (matchedPinnedActivity) => {
5057
- const newActivity = sharedUpdateActivity$5({
5121
+ const newActivity = sharedUpdateActivity$6({
5058
5122
  currentActivity: matchedPinnedActivity.activity,
5059
5123
  event,
5060
5124
  eventBelongsToCurrentUser
@@ -5097,7 +5161,7 @@ function handleBookmarkAdded(event) {
5097
5161
  const isSameBookmark = (bookmark1, bookmark2) => {
5098
5162
  return bookmark1.user.id === bookmark2.user.id && bookmark1.activity.id === bookmark2.activity.id && bookmark1.folder?.id === bookmark2.folder?.id;
5099
5163
  };
5100
- const sharedUpdateActivity$4 = ({
5164
+ const sharedUpdateActivity$5 = ({
5101
5165
  currentActivity,
5102
5166
  event,
5103
5167
  eventBelongsToCurrentUser
@@ -5117,7 +5181,7 @@ const sharedUpdateActivity$4 = ({
5117
5181
  const removeBookmarkFromActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5118
5182
  entities: activities,
5119
5183
  matcher: (activity) => activity.id === event.bookmark.activity.id,
5120
- updater: (matchedActivity) => sharedUpdateActivity$4({
5184
+ updater: (matchedActivity) => sharedUpdateActivity$5({
5121
5185
  currentActivity: matchedActivity,
5122
5186
  event,
5123
5187
  eventBelongsToCurrentUser
@@ -5127,7 +5191,7 @@ const removeBookmarkFromPinnedActivities = (event, pinnedActivities, eventBelong
5127
5191
  entities: pinnedActivities,
5128
5192
  matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
5129
5193
  updater: (matchedPinnedActivity) => {
5130
- const newActivity = sharedUpdateActivity$4({
5194
+ const newActivity = sharedUpdateActivity$5({
5131
5195
  currentActivity: matchedPinnedActivity.activity,
5132
5196
  event,
5133
5197
  eventBelongsToCurrentUser
@@ -5167,7 +5231,7 @@ function handleBookmarkDeleted(event) {
5167
5231
  });
5168
5232
  }
5169
5233
  }
5170
- const sharedUpdateActivity$3 = ({
5234
+ const sharedUpdateActivity$4 = ({
5171
5235
  currentActivity,
5172
5236
  event,
5173
5237
  eventBelongsToCurrentUser
@@ -5191,7 +5255,7 @@ const sharedUpdateActivity$3 = ({
5191
5255
  const updateBookmarkInActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5192
5256
  entities: activities,
5193
5257
  matcher: (activity) => activity.id === event.bookmark.activity.id,
5194
- updater: (matchedActivity) => sharedUpdateActivity$3({
5258
+ updater: (matchedActivity) => sharedUpdateActivity$4({
5195
5259
  currentActivity: matchedActivity,
5196
5260
  event,
5197
5261
  eventBelongsToCurrentUser
@@ -5201,7 +5265,7 @@ const updateBookmarkInPinnedActivities = (event, pinnedActivities, eventBelongsT
5201
5265
  entities: pinnedActivities,
5202
5266
  matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
5203
5267
  updater: (matchedPinnedActivity) => {
5204
- const newActivity = sharedUpdateActivity$3({
5268
+ const newActivity = sharedUpdateActivity$4({
5205
5269
  currentActivity: matchedPinnedActivity.activity,
5206
5270
  event,
5207
5271
  eventBelongsToCurrentUser
@@ -5332,7 +5396,7 @@ function handleActivityRemovedFromFeed(event) {
5332
5396
  }
5333
5397
  }
5334
5398
  }
5335
- const sharedUpdateActivity$2 = ({
5399
+ const sharedUpdateActivity$3 = ({
5336
5400
  currentActivity,
5337
5401
  event
5338
5402
  }) => {
@@ -5345,7 +5409,7 @@ const sharedUpdateActivity$2 = ({
5345
5409
  const updateActivityInState = (event, activities) => updateEntityInArray({
5346
5410
  entities: activities,
5347
5411
  matcher: (activity) => activity.id === event.activity.id,
5348
- updater: (matchedActivity) => sharedUpdateActivity$2({
5412
+ updater: (matchedActivity) => sharedUpdateActivity$3({
5349
5413
  currentActivity: matchedActivity,
5350
5414
  event
5351
5415
  })
@@ -5354,7 +5418,7 @@ const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInA
5354
5418
  entities: pinnedActivities,
5355
5419
  matcher: (pinnedActivity) => pinnedActivity.activity.id === event.activity.id,
5356
5420
  updater: (matchedPinnedActivity) => {
5357
- const newActivity = sharedUpdateActivity$2({
5421
+ const newActivity = sharedUpdateActivity$3({
5358
5422
  currentActivity: matchedPinnedActivity.activity,
5359
5423
  event
5360
5424
  });
@@ -5396,7 +5460,7 @@ function handleActivityUpdated(payload, fromWs) {
5396
5460
  });
5397
5461
  }
5398
5462
  }
5399
- const sharedUpdateActivity$1 = ({
5463
+ const sharedUpdateActivity$2 = ({
5400
5464
  payload,
5401
5465
  currentActivity,
5402
5466
  eventBelongsToCurrentUser
@@ -5417,7 +5481,7 @@ const sharedUpdateActivity$1 = ({
5417
5481
  const addReactionToActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5418
5482
  entities: activities,
5419
5483
  matcher: (activity) => activity.id === payload.activity.id,
5420
- updater: (matchedActivity) => sharedUpdateActivity$1({
5484
+ updater: (matchedActivity) => sharedUpdateActivity$2({
5421
5485
  payload,
5422
5486
  currentActivity: matchedActivity,
5423
5487
  eventBelongsToCurrentUser
@@ -5427,7 +5491,7 @@ const addReactionToPinnedActivities = (payload, pinnedActivities, eventBelongsTo
5427
5491
  entities: pinnedActivities,
5428
5492
  matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
5429
5493
  updater: (matchedPinnedActivity) => {
5430
- const updatedActivity = sharedUpdateActivity$1({
5494
+ const updatedActivity = sharedUpdateActivity$2({
5431
5495
  payload,
5432
5496
  currentActivity: matchedPinnedActivity.activity,
5433
5497
  eventBelongsToCurrentUser
@@ -5479,7 +5543,7 @@ function handleActivityReactionAdded(payload, fromWs) {
5479
5543
  });
5480
5544
  }
5481
5545
  }
5482
- const sharedUpdateActivity = ({
5546
+ const sharedUpdateActivity$1 = ({
5483
5547
  currentActivity,
5484
5548
  payload,
5485
5549
  eventBelongsToCurrentUser
@@ -5502,7 +5566,7 @@ const sharedUpdateActivity = ({
5502
5566
  const removeReactionFromActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5503
5567
  entities: activities,
5504
5568
  matcher: (activity) => activity.id === payload.activity.id,
5505
- updater: (matchedActivity) => sharedUpdateActivity({
5569
+ updater: (matchedActivity) => sharedUpdateActivity$1({
5506
5570
  currentActivity: matchedActivity,
5507
5571
  payload,
5508
5572
  eventBelongsToCurrentUser
@@ -5512,7 +5576,7 @@ const removeReactionFromPinnedActivities = (payload, activities, eventBelongsToC
5512
5576
  entities: activities,
5513
5577
  matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
5514
5578
  updater: (matchedPinnedActivity) => {
5515
- const newActivity = sharedUpdateActivity({
5579
+ const newActivity = sharedUpdateActivity$1({
5516
5580
  currentActivity: matchedPinnedActivity.activity,
5517
5581
  payload,
5518
5582
  eventBelongsToCurrentUser
@@ -5564,6 +5628,89 @@ function handleActivityReactionDeleted(payload, fromWs) {
5564
5628
  });
5565
5629
  }
5566
5630
  }
5631
+ const sharedUpdateActivity = ({
5632
+ payload,
5633
+ currentActivity,
5634
+ eventBelongsToCurrentUser
5635
+ }) => {
5636
+ const { activity: newActivity, reaction: newReaction } = payload;
5637
+ let ownReactions = currentActivity.own_reactions;
5638
+ if (eventBelongsToCurrentUser) {
5639
+ ownReactions = [newReaction];
5640
+ }
5641
+ return {
5642
+ ...currentActivity,
5643
+ latest_reactions: newActivity.latest_reactions,
5644
+ reaction_groups: newActivity.reaction_groups,
5645
+ reaction_count: newActivity.reaction_count,
5646
+ own_reactions: ownReactions
5647
+ };
5648
+ };
5649
+ const updateReactionInActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
5650
+ entities: activities,
5651
+ matcher: (activity) => activity.id === payload.activity.id,
5652
+ updater: (matchedActivity) => sharedUpdateActivity({
5653
+ payload,
5654
+ currentActivity: matchedActivity,
5655
+ eventBelongsToCurrentUser
5656
+ })
5657
+ });
5658
+ const updateReactionInPinnedActivities = (payload, pinnedActivities, eventBelongsToCurrentUser) => updateEntityInArray({
5659
+ entities: pinnedActivities,
5660
+ matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
5661
+ updater: (matchedPinnedActivity) => {
5662
+ const updatedActivity = sharedUpdateActivity({
5663
+ payload,
5664
+ currentActivity: matchedPinnedActivity.activity,
5665
+ eventBelongsToCurrentUser
5666
+ });
5667
+ if (updatedActivity === matchedPinnedActivity.activity) {
5668
+ return matchedPinnedActivity;
5669
+ }
5670
+ return {
5671
+ ...matchedPinnedActivity,
5672
+ activity: updatedActivity
5673
+ };
5674
+ }
5675
+ });
5676
+ function handleActivityReactionUpdated(payload, fromWs) {
5677
+ const connectedUser = this.client.state.getLatestValue().connected_user;
5678
+ const eventBelongsToCurrentUser = typeof connectedUser !== "undefined" && payload.reaction.user.id === connectedUser.id;
5679
+ if (!shouldUpdateState({
5680
+ stateUpdateQueueId: getStateUpdateQueueId(
5681
+ payload,
5682
+ "activity-reaction-updated"
5683
+ ),
5684
+ stateUpdateQueue: this.stateUpdateQueue,
5685
+ watch: this.currentState.watch,
5686
+ fromWs,
5687
+ isTriggeredByConnectedUser: eventBelongsToCurrentUser
5688
+ })) {
5689
+ return;
5690
+ }
5691
+ const {
5692
+ activities: currentActivities,
5693
+ pinned_activities: currentPinnedActivities
5694
+ } = this.currentState;
5695
+ const [result1, result2] = [
5696
+ this.hasActivity(payload.activity.id) ? updateReactionInActivities(
5697
+ payload,
5698
+ currentActivities,
5699
+ eventBelongsToCurrentUser
5700
+ ) : void 0,
5701
+ updateReactionInPinnedActivities(
5702
+ payload,
5703
+ currentPinnedActivities,
5704
+ eventBelongsToCurrentUser
5705
+ )
5706
+ ];
5707
+ if (result1?.changed || result2.changed) {
5708
+ this.state.partialNext({
5709
+ ...result1 ? { activities: result1.entities } : {},
5710
+ pinned_activities: result2.entities
5711
+ });
5712
+ }
5713
+ }
5567
5714
  const updateNotificationStatusFromActivityMarked = (event, currentNotificationStatus, aggregatedActivities = []) => {
5568
5715
  if (!currentNotificationStatus) {
5569
5716
  return {
@@ -5760,7 +5907,7 @@ const _Feed = class _Feed extends FeedApi {
5760
5907
  "feeds.activity.deleted": handleActivityDeleted.bind(this),
5761
5908
  "feeds.activity.reaction.added": handleActivityReactionAdded.bind(this),
5762
5909
  "feeds.activity.reaction.deleted": handleActivityReactionDeleted.bind(this),
5763
- "feeds.activity.reaction.updated": _Feed.noop,
5910
+ "feeds.activity.reaction.updated": handleActivityReactionUpdated.bind(this),
5764
5911
  "feeds.activity.removed_from_feed": handleActivityRemovedFromFeed.bind(this),
5765
5912
  "feeds.activity.updated": handleActivityUpdated.bind(this),
5766
5913
  "feeds.bookmark.added": handleBookmarkAdded.bind(this),
@@ -5781,7 +5928,7 @@ const _Feed = class _Feed extends FeedApi {
5781
5928
  "feeds.follow.updated": handleFollowUpdated.bind(this),
5782
5929
  "feeds.comment.reaction.added": handleCommentReactionAdded.bind(this),
5783
5930
  "feeds.comment.reaction.deleted": handleCommentReactionDeleted.bind(this),
5784
- "feeds.comment.reaction.updated": _Feed.noop,
5931
+ "feeds.comment.reaction.updated": handleCommentReactionUpdated.bind(this),
5785
5932
  "feeds.feed_member.added": handleFeedMemberAdded.bind(this),
5786
5933
  "feeds.feed_member.removed": handleFeedMemberRemoved.bind(this),
5787
5934
  "feeds.feed_member.updated": handleFeedMemberUpdated.bind(this),
@@ -6475,9 +6622,14 @@ class FeedsClient extends FeedsApi {
6475
6622
  return response;
6476
6623
  };
6477
6624
  this.addActivityReaction = async (request) => {
6625
+ const shouldEnforceUnique = request.enforce_unique;
6478
6626
  const response = await super.addActivityReaction(request);
6479
6627
  for (const feed of Object.values(this.activeFeeds)) {
6480
- handleActivityReactionAdded.bind(feed)(response, false);
6628
+ if (shouldEnforceUnique) {
6629
+ handleActivityReactionUpdated.bind(feed)(response, false);
6630
+ } else {
6631
+ handleActivityReactionAdded.bind(feed)(response, false);
6632
+ }
6481
6633
  }
6482
6634
  return response;
6483
6635
  };
@@ -6492,9 +6644,14 @@ class FeedsClient extends FeedsApi {
6492
6644
  return response;
6493
6645
  };
6494
6646
  this.addCommentReaction = async (request) => {
6647
+ const shouldEnforceUnique = request.enforce_unique;
6495
6648
  const response = await super.addCommentReaction(request);
6496
6649
  for (const feed of Object.values(this.activeFeeds)) {
6497
- handleCommentReactionAdded.bind(feed)(response, false);
6650
+ if (shouldEnforceUnique) {
6651
+ handleCommentReactionUpdated.bind(feed)(response, false);
6652
+ } else {
6653
+ handleCommentReactionAdded.bind(feed)(response, false);
6654
+ }
6498
6655
  }
6499
6656
  return response;
6500
6657
  };
@@ -6862,4 +7019,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
6862
7019
  exports.shouldUpdateState = shouldUpdateState;
6863
7020
  exports.uniqueArrayMerge = uniqueArrayMerge;
6864
7021
  exports.updateEntityInArray = updateEntityInArray;
6865
- //# sourceMappingURL=index-DRX66SIx.js.map
7022
+ //# sourceMappingURL=index-nq6SDtbt.js.map