matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.28k stars 254 forks source link

RoomListItem.roomInfo().displayName() often null #4051

Open ganfra opened 2 months ago

ganfra commented 2 months ago

When building the room summaries, we got a lot of RoomListItem.roomInfo().displayName() being null. Then after some time, they get updated, but only in memory. Indeed, when launching the app in airplane mode, we got null values again for most of the rooms, even if the app had all the names before killing the app.

I've checked the code, and the persistence to disk is only made during a next sync in the room only if there is new event in the room. So if you never get updates for a room, his display name will never be saved to disk.

It'd be great to have the displayName computed synchronously and not async, so we don't get null display name while we have avatar, and so it'd be saved to disk directly.

bnjbvr commented 2 months ago

Thanks for opening an issue, good catch. Computing the displayName synchronously would require a deep overhaul of the compute-room-name logic, which relies on events stored in the database at the moment; we should likely make it more generic and rely on database-or-sync, and save it immediately (even if the computing is async).