Bug Report: FeedState stream emits stale state for 'comment', 'reaction', and 'comment_reaction' activity types
Package version: stream_feeds: ^0.5.0
Description
When listening to Feed.stream for notification feeds, the stream does emit when new activities of type 'comment', 'reaction', or 'comment_reaction' are received, but it emits the old/stale state instead of the updated state containing the new activity.
Expected behavior
When a new comment, reaction, or comment_reaction activity is added to the feed, the FeedState stream should emit a new state that includes the newly added activity.
Actual behavior
The stream listener is triggered when activities of type 'comment', 'reaction', or 'comment_reaction' are added, but the emitted FeedState contains the previous state without the new activity. The new activity only appears after manually refreshing the feed.
Important: When re-initializing the feed (calling getOrCreate() again), the initial state is correct and includes the new notifications. This indicates the issue is specifically with the stream not emitting the updated state.
Code to reproduce
final query = FeedQuery(
fid: FeedId.notification(client.user.id),
);
final feed = client.feedFromQuery(query);
await feed.getOrCreate();
notificationsStream = feed.stream.listen((streamState) {
// When activity.type is 'comment', 'reaction', or 'comment_reaction':
// - This callback IS called
// - But streamState.activities contains the OLD state, not the new activity
print('Activities: ${streamState.activities}');
});
Impact
Notification badges and real-time notification lists do not update when users receive comments or reactions on their posts, even though the stream event fires.
Bug Report: FeedState stream emits stale state for 'comment', 'reaction', and 'comment_reaction' activity types
Package version:
stream_feeds: ^0.5.0Description
When listening to
Feed.streamfor notification feeds, the stream does emit when new activities of type'comment','reaction', or'comment_reaction'are received, but it emits the old/stale state instead of the updated state containing the new activity.Expected behavior
When a new
comment,reaction, orcomment_reactionactivity is added to the feed, theFeedStatestream should emit a new state that includes the newly added activity.Actual behavior
The stream listener is triggered when activities of type
'comment','reaction', or'comment_reaction'are added, but the emittedFeedStatecontains the previous state without the new activity. The new activity only appears after manually refreshing the feed.Important: When re-initializing the feed (calling
getOrCreate()again), the initial state is correct and includes the new notifications. This indicates the issue is specifically with the stream not emitting the updated state.Code to reproduce
Impact
Notification badges and real-time notification lists do not update when users receive comments or reactions on their posts, even though the stream event fires.