You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
This may be me not understanding how presence_stream table is utilized, but I noticed dissapearing rows from presence_stream database table. More tangible effect may be that only one online user has a green dot showing online status in element and the rest doesn't get a dot at all.
My explanation:
few people are online
server wants to refresh their states invoking _update_presence_txn method in PresenceStore
new online and offline states get inserted as rows to presence_stream
we iterate through users we refreshed and delete old rows. The query in pseudocode look like delete rows from presence_stream where stream_id < $stream_id and user_id is $user_id. user_id is iterated over, but the stream_id is a remnant from previous loop
so when we left previous loop the stream_id can be the maximum stream_id we inserted, causing every record we inserted to get deleted except the one with highest stream_id
I guess my question is: is it a bug or am I missing something? In case I'm right I have a pull request ready.
Steps to reproduce
Turn on presence and look at presence_stream table table for few minutes with multiple online clients.
Version information
Every version I used so far, develop too.
The text was updated successfully, but these errors were encountered:
Yep, I believe you're correct! I wrote a quick test for this on a branch at 258bf0e and the results are that we only end up with one presence update in the database, rather than the 5 we desire.
We'd very happily accept a pull request that fixes the bug - thanks!
#9962 uncovered that we accidentally removed all but one of the presence updates that we store in the database when persisting multiple updates. This could cause users' presence state to be stale.
The bug was fixed in #10014, and this PR just adds a test that failed on the old code, and was used to initially verify the bug.
The test attempts to insert some presence into the database in a batch using `PresenceStore.update_presence`, and then simply pulls it out again.
Description
This may be me not understanding how presence_stream table is utilized, but I noticed dissapearing rows from presence_stream database table. More tangible effect may be that only one online user has a green dot showing online status in element and the rest doesn't get a dot at all.
My explanation:
delete rows from presence_stream where stream_id < $stream_id and user_id is $user_id
. user_id is iterated over, but the stream_id is a remnant from previous loopI guess my question is: is it a bug or am I missing something? In case I'm right I have a pull request ready.
Steps to reproduce
Turn on presence and look at presence_stream table table for few minutes with multiple online clients.
Version information
Every version I used so far, develop too.
The text was updated successfully, but these errors were encountered: