Skip to content

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Oct 16, 2025

Goal

Continuing to add event handling, this time for FeedCreatedEvent.

Implementation

  • Map WS event to StateUpdateEvent and handle where needed
  • I also took the opportunity to move the filter check from the state to the handler

Testing

Testing manually would require creating a feed, which I don't think it's doable from the sample atm

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 16, 2025 08:02
@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 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 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 event handling for the FeedCreatedEvent WebSocket event and refactors filter checking logic to improve maintainability. The key changes include mapping the WS event to a new StateUpdateEvent.FeedAdded and moving filter validation from state classes to event handlers.

  • Introduces StateUpdateEvent.FeedAdded to handle feed creation events
  • Moves filter matching logic from state implementations to event handlers
  • Renames onFeedUpdated to onFeedUpserted to better reflect its upsert behavior

Reviewed Changes

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

Show a summary per file
File Description
StateUpdateEvent.kt Adds FeedAdded event and maps FeedCreatedEvent to it
FeedEventHandler.kt Adds filter parameter and handles FeedAdded event; moves activity filter checks from state to handler
FeedListEventHandler.kt Adds filter parameter and handles FeedAdded event with filter matching
FeedStateImpl.kt Removes filter checks from onActivityAdded and onActivityUpdated
FeedListStateImpl.kt Renames onFeedUpdated to onFeedUpserted and implements proper upsert logic
FilterMatch.kt New utility file for filter matching with null-safe handling
List.kt Generalizes upsertSorted ID selector from String to generic type
FeedImpl.kt Passes activity filter to FeedEventHandler
FeedListImpl.kt Passes feeds filter to FeedListEventHandler
TestData.kt Makes createdAt parameter configurable in test data factory
FeedEventHandlerTest.kt Adds test coverage for FeedAdded event and filter matching scenarios
FeedListEventHandlerTest.kt Adds test coverage for FeedAdded event and updates existing tests
FeedStateImplTest.kt Removes tests moved to handler level
FeedListStateImplTest.kt Updates tests to reflect renamed method and upsert behavior

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

SDK Size Comparison 📏

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

@gpunto gpunto added the pr:new-feature New feature label Oct 16, 2025
@gpunto gpunto marked this pull request as ready for review October 16, 2025 08:09
@gpunto gpunto force-pushed the handle-feedcreated branch from 262ebba to bcb9f08 Compare October 20, 2025 07:39
@gpunto gpunto force-pushed the handle-feedcreated branch from 1097a77 to 814b5b2 Compare October 20, 2025 07:44
@sonarqubecloud
Copy link

@VelikovPetar VelikovPetar merged commit 7611de5 into develop Oct 20, 2025
7 checks passed
@VelikovPetar VelikovPetar deleted the handle-feedcreated branch October 20, 2025 07:50
gpunto added a commit that referenced this pull request Oct 20, 2025
* Handle FeedCreatedEvent

* Move Feed filter check to FeedEventHandler

* Rename filter parameter to activityFilter

* Remove FeedAdded handling for Feed
VelikovPetar pushed a commit that referenced this pull request Oct 20, 2025
* Use new built-in story feeds in the sample

* Add event handling for the feed created event (#117)

* Handle FeedCreatedEvent

* Move Feed filter check to FeedEventHandler

* Rename filter parameter to activityFilter

* Remove FeedAdded handling for Feed

* Add missing doc for isWatched

* Unfollow story feed on unfollowing user
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