Skip to content

Add "Not" or "Exclude" Filter to RoomListEntriesDynamicFilterKind #5978

@younasb

Description

@younasb

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:

  1. Favorites: All(Favourite, Joined)
  2. Direct Messages: All(Category.People, Joined)
  3. 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:

  1. Fetch the room in the Direct Messages subscription.
  2. Fetch its metadata.
  3. Check isFavourite.
  4. 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

  1. SDK accepts a filter configuration that excludes Favorite rooms.
  2. The RoomListEntriesListener does not receive Append, Insert, or Push events for rooms that match the excluded criteria.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions