Skip to content

Conversation

gpunto
Copy link
Contributor

@gpunto gpunto commented Oct 8, 2025

Goal

Part of AND-796

Continuing to add missing event handling (and refactoring handler tests to parameterized tests). This PR adds handling of comment reaction events for Feed.

Implementation

The logic to change comment reactions is basically the same as the one for activity reactions implemented in #97

Testing

Not trivial to test manually in the sample because the comment reactions we're displaying don't come from a Feed instance, but from Activity. What one would need to do, for example, is adding code to observe and log comment reactions in an activity from Feed.state, then change comment reactions (even from the UI), and check that the emitted new comment reactions are correct.

Checklist

  • Issue linked (if any)
  • Tests/docs updated
  • I have signed the Stream CLA (required for external contributors)

@gpunto gpunto requested a review from Copilot October 8, 2025 10:49
Copy link
Contributor

github-actions bot commented Oct 8, 2025

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds handling for comment reaction events (upserted and removed) in the Feed component to address missing event handling functionality. The implementation follows the same pattern as activity reaction handling added in a previous PR.

Key changes include:

  • Added CommentReactionAdded, CommentReactionDeleted, and CommentReactionUpdated event handling in FeedEventHandler
  • Extended StateUpdateEvent classes to include feed ID parameter for comment reaction events
  • Added state update methods for comment reactions in FeedStateUpdates interface and implementation
  • Refactored test classes to use parameterized tests for better maintainability

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
FeedEventHandler.kt Added handlers for comment reaction events with feed ID matching
StateUpdateEvent.kt Extended comment reaction events to include feed ID parameter
FeedStateImpl.kt Implemented comment reaction state update methods and added utility functions
ActivityData.kt Added helper functions for updating comment reactions within activities
CommentData.kt Added reaction manipulation utility functions for comments
Various test files Updated to use parameterized tests and adjusted for new event signatures
Comments suppressed due to low confidence (1)

stream-feeds-android-client/src/test/kotlin/io/getstream/feeds/android/client/internal/test/TestData.kt:1

  • The test name 'BookmarkUpserted' should be 'BookmarkUpdated' to match the actual event being tested (BookmarkUpdated).
/*

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gpunto gpunto added the pr:new-feature New feature label Oct 8, 2025
Copy link
Contributor

github-actions bot commented Oct 8, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-feeds-android-client 2.48 MB 2.48 MB 0.00 MB 🟢

@gpunto gpunto force-pushed the more-event-handling-3 branch from 5cba573 to 1453860 Compare October 8, 2025 10:59
@gpunto gpunto marked this pull request as ready for review October 8, 2025 10:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

sonarqubecloud bot commented Oct 8, 2025

@VelikovPetar VelikovPetar merged commit e769445 into develop Oct 10, 2025
7 checks passed
@VelikovPetar VelikovPetar deleted the more-event-handling-3 branch October 10, 2025 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:new-feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants