publicRooms endpoint does not filter by room type #697

Closed
opened 2025-03-06 19:41:08 +00:00 by gingershaped · 0 comments
gingershaped commented 2025-03-06 19:41:08 +00:00 (Migrated from github.com)

Conduwuit's implementation of the publicRooms endpoint ignores the room_types field when filtering local rooms, causing clients like Cinny to always return both rooms and spaces regardless of which room type is selected to filter by. Specifically, api::client::directory::get_public_rooms_filtered_helper does not check filter.room_types when filtering the server's public rooms.

Conduwuit does appear to correctly pass filter.room_types to remote servers when looking up a room directory over federation; however, I observed that Cinny's filtering options were broken for both local and remote rooms. I'm unsure what causes this behavior.

Conduwuit's implementation of the [`publicRooms`](https://spec.matrix.org/unstable/client-server-api/#post_matrixclientv3publicrooms) endpoint ignores the `room_types` field when filtering local rooms, causing clients like Cinny to always return both rooms and spaces regardless of which room type is selected to filter by. Specifically, [`api::client::directory::get_public_rooms_filtered_helper`](https://github.com/girlbossceo/conduwuit/blob/e3b81f7b6488b5c483e8b13e3959fe591bf4cb92/src/api/client/directory.rs#L228) does not check `filter.room_types` when filtering the server's public rooms. Conduwuit does appear to [correctly pass](https://github.com/girlbossceo/conduwuit/blob/e3b81f7b6488b5c483e8b13e3959fe591bf4cb92/src/api/client/directory.rs#L248) `filter.room_types` to remote servers when looking up a room directory over federation; however, I observed that Cinny's filtering options were broken for both local _and_ remote rooms. I'm unsure what causes this behavior.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#697
No description provided.