-
Couldn't load subscription status.
- Fork 1
Add event handling for the feed created event #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
There was a problem hiding this 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.FeedAddedto handle feed creation events - Moves filter matching logic from state implementations to event handlers
- Renames
onFeedUpdatedtoonFeedUpsertedto 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.
SDK Size Comparison 📏
|
...in/kotlin/io/getstream/feeds/android/client/internal/state/event/handler/FeedEventHandler.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/io/getstream/feeds/android/client/internal/state/event/handler/FeedEventHandler.kt
Outdated
Show resolved
Hide resolved
262ebba to
bcb9f08
Compare
1097a77 to
814b5b2
Compare
|
* Handle FeedCreatedEvent * Move Feed filter check to FeedEventHandler * Rename filter parameter to activityFilter * Remove FeedAdded handling for Feed
* 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



Goal
Continuing to add event handling, this time for
FeedCreatedEvent.Implementation
StateUpdateEventand handle where neededTesting
Testing manually would require creating a feed, which I don't think it's doable from the sample atm
Checklist