-
Notifications
You must be signed in to change notification settings - Fork 362
Open
Description
Hello, I'm writing on behalf of the Citadel product developed by ERCOM.
Add capability to exclude specific filters (like Favorites) within RoomListEntriesDynamicFilterKind
Description
Currently, when setting up room list subscriptions, we can combine filters using .All() (AND logic) or .Any() (OR logic). However, there is no mechanism to exclude or negate a filter.
We are implementing a standard 3-section room list:
- Favorites:
All(Favourite, Joined) - Direct Messages:
All(Category.People, Joined) - Regular Rooms:
All(Category.Group, Joined)
The Problem:
A room that is both a "Direct Message" AND a "Favorite" appears in both the Favorites section and the Direct Messages section.
To prevent duplicates in the UI, we currently have to:
- Fetch the room in the Direct Messages subscription.
- Fetch its metadata.
- Check
isFavourite. - Manually filter it out on the client side.
This is inefficient because:
- We receive updates for rooms we don't intend to show in that section.
- We have to maintain complex client-side filtering logic.
- It complicates index-based updates (Insert/Remove) because the SDK's index includes the hidden rooms.
Suggested Solution
Please add a Not filter kind or an exclude property to the existing filter system.
Not Filter Wrapper
Allow wrapping a filter in a negation:
new RoomListEntriesDynamicFilterKind.All({
filters: [
new RoomListEntriesDynamicFilterKind.Category({ expect: RoomListFilterCategory.People }),
new RoomListEntriesDynamicFilterKind.Joined(),
// NEW: Exclude favorites
new RoomListEntriesDynamicFilterKind.Not({
filter: new RoomListEntriesDynamicFilterKind.Favourite()
})
]
})Impact
- Reduces client-side memory usage (no duplicate storage).
- Reduces network traffic (no updates for hidden rooms).
- Simplifies client-side state management (removes risk of index corruption during manual filtering).
Acceptance Criteria
- SDK accepts a filter configuration that excludes Favorite rooms.
- The
RoomListEntriesListenerdoes not receiveAppend,Insert, orPushevents for rooms that match the excluded criteria.
Metadata
Metadata
Assignees
Labels
No labels