Skip to content

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Sep 24, 2025

Goal

Implement changes to filter WS events locally so we can avoid handling events that don't match filters.

Core PR: GetStream/stream-core-android#14
iOS PR: GetStream/stream-feeds-swift#14

Implementation

  • Implement localValue lambda for all filter fields. Note: some are not implemented because the local value doesn't exist
  • Added/removed some filter fields based on what the backend actually supports
  • Use matches function to filter activity added & updated events

Testing

An example where the effect of local filtering is evident is in the sample when creating a post or a story. Before, either would show up in both the regular timeline and the stories row, while now they only show up the correct place.

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 September 24, 2025 07:46
@gpunto gpunto changed the title Match events against filters Match WS events against filters Sep 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 24, 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.

@gpunto gpunto added pr:bug Bug fix pr:new-feature New feature and removed pr:bug Bug fix labels Sep 24, 2025
Copy link
Contributor

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 pull request implements local filtering for WebSocket events to avoid handling events that don't match configured filters. The core change replaces the generic QueryConfiguration system with type-safe query configurations and adds local filtering capabilities for activity added/updated events.

Key changes:

  • Updated all filter fields to support local value extraction through lambda functions
  • Migrated from the generic QueryConfiguration to specific typed configurations
  • Implemented local filtering for activity events using the matches function
  • Updated package structure from filter to sort for sort-related components

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Test files Updated import statements and replaced generic QueryConfiguration with specific typed configurations
State implementation files Added local filtering logic for activity events and updated query configuration types
Query definition files Enhanced filter fields with local value extraction lambdas and updated type parameters
Utility files Updated import paths for sort-related components
Repository files Updated imports from filter to sort package
gradle/libs.versions.toml Upgraded streamAndroidCore dependency version

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 Sep 24, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-feeds-android-client 2.45 MB 2.46 MB 0.01 MB 🟢

@gpunto gpunto marked this pull request as ready for review September 24, 2025 08:36
@gpunto gpunto merged commit ffbdf96 into develop Sep 24, 2025
6 checks passed
@gpunto gpunto deleted the match-events-against-filters branch September 24, 2025 11:07
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.

4 participants