When calling the Widget API using .readRoomEvents just after a page reload, only a subset of events are returned #20897
Labels
A-Widgets
O-Uncommon
Most users are unlikely to come across this or unexpected workflow
S-Major
Severely degrades major functionality or product features, with no satisfactory workaround
T-Defect
Steps to reproduce
matrix-widget-api
package and paste the code intoApp.js
.HTTPS=true npm start
, add it to a room (I'm using plaintext rooms for testing because of past issues with encrypted rooms) with/addwidget https://localhost:3000
and pin it.Send 100
button and wait 100 seconds. Some patience is needed because of the rate limiting.F5
.Read
button. Suddenly all 100 events are there.App.js
and change the value ofMS_TO_WAIT
from0
to5000
.Outcome
What did you expect?
I expected that the Widget API would take care of only reading the events once Element is ready and return me the 100 events that are in the room.
What happened instead?
It seems like Element needs some time before it has all the events. There's no event to tell me when Element is ready, so I have to wait an arbitrary amount of time (such as 5 seconds) before reading events.
It's worth noting the issue also occurs in other cases when Element is reloaded, such as when the user updates Element (on develop.element.io I get update prompts regularly).
Operating system
macOS Monterey Version 12.1
Browser information
Google Chrome Version 97.0.4692.99 (Official Build) (arm64)
URL for webapp
develop.element.io
Application version
Element version: 64242a0-react-29cf22a5212c-js-b07457726bf5, Olm version: 3.2.8
Homeserver
matrix.org
Will you send logs?
Yes
The text was updated successfully, but these errors were encountered: