prose-im / prose-app-web

Prose Web application. XMPP client for team messaging.
https://prose.org/downloads
Mozilla Public License 2.0
23 stars 2 forks source link

Roster load storm on startup #37

Closed valeriansaliou closed 7 months ago

valeriansaliou commented 8 months ago

When the Prose app starts, I receive multiple contactChanged and roomsChanged events, leading to local roster invalidation and reload. This ultimately leads to the app requesting the roster multiple times to the server in parallel.

Those screenshots show the event/stanza storm on startup, which happen in a second or so:

image image

valeriansaliou commented 8 months ago

Poke @nesium

nesium commented 8 months ago

I had that on my list for a while. I'll give it a go. Would like to handle it in the core.

valeriansaliou commented 8 months ago

Perfect, sounds good yes!

valeriansaliou commented 8 months ago

I think that ideally the roster should be loaded once by the core, and and then maintained w/ roster pushes from the server. Calling load roster on the app's side would not load the roster from the server if called a second time, rather return storage-backed roster data.

nesium commented 8 months ago

Events are now throttled and coalesced. Please note the slight change in the delegate signature:

Screenshot 2024-02-05 at 19 32 56

Edit: Messed up the link in the commit message (https://github.com/prose-im/prose-core-client/commit/fb1f7f274cfe4c1a8cfcc6a362d4612caa0e7b95)