Description
Previously, widgets couldn't read/receive room events in end-to-end encrypted rooms (#17615). This was addressed in matrix-org/matrix-react-sdk#6371, but after testing the implementation I noticed that reading and receiving room events has a very different behavior in encrypted rooms than it does in plaintext ones (reading refers to using .readRoomEvents whereas receiving refers to using .on('action:send_event', ...):
In plaintext rooms you get the last 25 events when reading, but in encrypted rooms you actually get the first 25 that were sent.
- In plaintext rooms you get the events in the reverse order they were sent when reading, but in encrypted rooms they arrive in seemingly random order. Admittedly, this can be solved by sorting them by timestamp, but the behaviour is still different.
- Both when reading and receiving the events arrive with a considerable delay (up to 5 seconds) that's not present in plaintext rooms.
- When reading in plaintext rooms the events are all received at the same time as an array, whereas in encrypted rooms they sometimes arrive one after the other (with a delay in between). I can't reproduce this behaviour right now - but this was definitely happening before.
- In plaintext rooms there's no unread message indicator for events that are not shown in the timeline, but in encrypted rooms there is. This is minor, but still an inconsistency.
Steps to reproduce
- Join an encrypted room
- Send a room event and measure how long it takes to receive it back
- Send some more room events and refresh the page
- Read room events and measure how long it takes to receive them
- Note whether they all arrive at the same time or one by one and in what order
- See if there's an unread message indicator
- Send 50 events and see which 25 you get back when reading - the first 25 or the last 25
In plaintext rooms I receive an event back almost immediately. When I refresh the page and read room events, I get the last 25 almost immediately, all at the same time and in the reverse order they were sent. There's no unread message indicator.
Logs being sent: yes
Version information
- Platform: web (in-browser)
- Browser: Chrome 91.0.4472.114 (Official Build) (arm64)
- OS: macOS 11.4 (20F71)
- URL: develop.element.io
Description
Previously, widgets couldn't read/receive room events in end-to-end encrypted rooms (#17615). This was addressed in matrix-org/matrix-react-sdk#6371, but after testing the implementation I noticed that reading and receiving room events has a very different behavior in encrypted rooms than it does in plaintext ones (reading refers to using .readRoomEvents whereas receiving refers to using .on('action:send_event', ...):
In plaintext rooms you get the last 25 events when reading, but in encrypted rooms you actually get the first 25 that were sent.Steps to reproduce
In plaintext rooms I receive an event back almost immediately. When I refresh the page and read room events, I get the last 25 almost immediately, all at the same time and in the reverse order they were sent. There's no unread message indicator.
Logs being sent: yes
Version information