From 4f629c87c06b3b1b428c0dedee3fead7fb024aeb Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Tue, 28 Oct 2025 13:26:52 +0100 Subject: [PATCH 1/2] Improve on local FeedsReactionData id --- .../stream_feeds/lib/src/models/feeds_reaction_data.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/stream_feeds/lib/src/models/feeds_reaction_data.dart b/packages/stream_feeds/lib/src/models/feeds_reaction_data.dart index 3739bd21..3e477447 100644 --- a/packages/stream_feeds/lib/src/models/feeds_reaction_data.dart +++ b/packages/stream_feeds/lib/src/models/feeds_reaction_data.dart @@ -14,6 +14,7 @@ class FeedsReactionData with _$FeedsReactionData { /// Creates a new [FeedsReactionData] instance. const FeedsReactionData({ required this.activityId, + this.commentId, required this.createdAt, required this.type, required this.updatedAt, @@ -25,6 +26,8 @@ class FeedsReactionData with _$FeedsReactionData { @override final String activityId; + final String? commentId; + /// The date and time when the reaction was created. @override final DateTime createdAt; @@ -46,7 +49,8 @@ class FeedsReactionData with _$FeedsReactionData { final Map? custom; /// Unique identifier for the reaction, generated from the activity ID and user ID. - String get id => '$activityId${user.id}'; + String get id => + '${user.id}-$type${commentId == null ? '' : '-$commentId'}-$activityId'; } /// Extension function to convert a [FeedsReactionResponse] to a [FeedsReactionData] model. @@ -55,6 +59,7 @@ extension FeedsReactionResponseMapper on FeedsReactionResponse { FeedsReactionData toModel() { return FeedsReactionData( activityId: activityId, + commentId: commentId, createdAt: createdAt, type: type, updatedAt: updatedAt, From 301a1a94a197d425b44a6819a6cb92efb4f8edbb Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Tue, 28 Oct 2025 13:29:58 +0100 Subject: [PATCH 2/2] update changelog --- packages/stream_feeds/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_feeds/CHANGELOG.md b/packages/stream_feeds/CHANGELOG.md index 9567bd0f..ac5dab23 100644 --- a/packages/stream_feeds/CHANGELOG.md +++ b/packages/stream_feeds/CHANGELOG.md @@ -1,5 +1,6 @@ ## unreleased - Update follower and following counts on the feed state when receiving follow websocket events. +- Fix FeedsReactionData id for updating reactions in the feed state. ## 0.3.1 - Update API client with renaming `addReaction` to `addActivityReaction` and `deleteReaction` to `deleteActivityReaction`.