Skip to content

Let channel list factories build the filter from the connected user - #6862

Closed
gpunto wants to merge 1 commit into
fix/and-1667-channel-list-clear-on-user-changefrom
feat/and-1667-channel-list-filter-from-user
Closed

gpunto wants to merge 1 commit into
fix/and-1667-channel-list-clear-on-user-changefrom
feat/and-1667-channel-list-filter-from-user

Conversation

@gpunto

@gpunto gpunto commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Goal

A channel list whose filter contains the user's id only worked for one user: after a switch, the new user's list was queried with the previous user's id unless the app called setFilters or recreated the view model, and predefined filters had no way to change at all.

Part of AND-1667. Stacked on #6861.

Implementation

  • New ChannelListViewModelFactory constructors in Compose and XML that take the filter as (User) -> FilterObject, and predefined filter values as (User) -> Map<String, Any>.
  • The view model builds them for the connected user, and again when another user connects, using the reload from Clear the channel list and message search when the user logs out or another user connects #6861. One view model can serve every user.
  • The default filter is now the built-in case of the same mechanism. setFilters still takes over from it.
  • Factories only, not the view models' public constructors.
  • Java callers passing a literal null as the first argument now need a cast, since it matches both overloads.

Testing

  • The Compose and XML ChannelListViewModelTests cover a switch to another user, the same user logging back in, setFilters overriding a filter built from the user, and predefined values per user.

@gpunto gpunto added the pr:new-feature New feature label Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.24 MB 6.24 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.56 MB 11.56 MB 0.00 MB 🟢
stream-chat-android-compose 13.23 MB 13.23 MB 0.00 MB 🟢
stream-chat-android-ai-compose 2.07 MB 2.07 MB 0.00 MB 🟢
stream-chat-android-ai-ondevice 1.67 MB 1.67 MB 0.00 MB 🟢

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
50.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@gpunto

gpunto commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now: with #6861, calling setFilters with the new user's filter before the list reloads (for example from a collector on clientState.user) covers user-dependent filters without new API. The branch stays around in case more apps need a filter built from the user.

@gpunto gpunto closed this Oct 21, 2026
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.

1 participant