Skip to content

Handle all room info changes in the room list service stream#607

Merged
kevinaboos merged 8 commits into
project-robius:mainfrom
kevinaboos:tombstone_update_infallible
Oct 22, 2025
Merged

Handle all room info changes in the room list service stream#607
kevinaboos merged 8 commits into
project-robius:mainfrom
kevinaboos:tombstone_update_infallible

Conversation

@kevinaboos
Copy link
Copy Markdown
Member

@kevinaboos kevinaboos commented Oct 17, 2025

Instead of checking the latest event's content to catch changes, which is fallible as it may miss certain events, we now handle it entirely in the stream of changes that comes from the RoomListService.

Side note: I still feel like there must be a better way to do this, since we ideally wouldn't need to maintain virtually the entire state of the room in a separate cached struct (see RoomListServiceRoomInfo), but I currently cannot see any other means of doing so.

We also still have to check for an update to the latest event ON EVERY CHANGE to the room, which seems wildly inefficient. We can't even use the new_latest_event_timestamp() to check if the latest event actually has been updated more recently than others.
One reason for this is that certain events, like redactions, seem to not trigger a change to the room, or they don't update the timestamp of the latest event API, so if we don't blindly update the latest event upon every room change, then redactions are skipped, which means the deleted message content is still shown incorrectly.

However, we have still improved the handling of lots of other room info kinds, e.g., tags, unreads, room display name & avatar, tombstoned state, is_direct state, power levels, etc.

Ensure that we use the RoomTombstoneEventContent to infallibly inform the RoomScreen UI widget that a given room has been tombstoned and that its successor room is now known.

TODO before merging: create the RoomListServiceRoomInfo for the new room before calling update_room(), and pass a reference to that into update_room() as the new_room. That will avoid the duplicate code in RoomListServiceRoomInfo::from_room() and in this range of code:
https://github.com/kevinaboos/robrix/blob/475cfed1b6cbc03f969040d11b24ef2074d5be5e/src/sliding_sync.rs#L2189-L2273
done ✅

Closes #606.
Closes #586.

Ensure that we use the `RoomTombstoneEventContent` to infallibly inform
the RoomScreen UI widget that a given room has been tombstoned
and that its successor room is now known.

Closes project-robius#606
kevinaboos and others added 3 commits October 20, 2025 12:26
Instead of checking the latest event's content to catch changes,
(which is fallible as it may miss certain events),
we now handle it entirely in the stream of changes that comes from
the RoomListService.

I still feel like there must be a better way to do this, since we ideally
wouldn't need to maintain virtually the entire state of the room in a
separate cached struct (see `RoomListServiceRoomInfo`),
but I currently cannot see any other means of doing so.

We also still have to check for an update to the latest event
ON EVERY CHANGE to the room, which seems wildly inefficient.
We can't even use the `new_latest_event_timestamp()` to check if the
latest event actually has been updated more recently than others.
One reason for this is that certain events, like redactions, seem to
not update the timestamp, so if we don't blindly update the latest event
upon every room change, then redactions are skipped (incorrectly).

However, we have still improved the handling of lots of other room info
kinds, e.g., tags, unreads, room display name & avatar, tombstoned state,
`is_direct` state, power levels, etc.
@kevinaboos kevinaboos changed the title Obtain the successor room info infallibly to send a timeline update Handle all room info changes in the room list service stream Oct 22, 2025
…e functions

This avoids duplicate code in `update_room()` and is also much more efficient
when re-using room info that we have already obtained up front (right after
discovering a new room from the room_list_service stream)
@kevinaboos kevinaboos removed the waiting-on-review This issue is waiting to be reviewed label Oct 22, 2025
@kevinaboos
Copy link
Copy Markdown
Member Author

Reviewed, tested, and ready to merge 🚀

@kevinaboos kevinaboos merged commit e0b96bf into project-robius:main Oct 22, 2025
11 checks passed
@kevinaboos kevinaboos deleted the tombstone_update_infallible branch October 22, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Robrix does not offer navigation to successor room after m.room.tombstone Migrate to the "new latest event" API

1 participant