using a FIFO queue.
This is needed in order to lower the priority of getting group
state and prioritise everything else, namely initial sync.
It should be noted that this by no means guarantees that the
first incremental sync will happen sooner; the client could
end up doing some other requests first instead.
For each successful request of a group profile, we previously
emitted an `updateGroupProfile` event per caller of
`getGroupProfileCached`. This is sub-optimal because only a single
event emit is required to update the views listening.
It's possible that this was enabling some race to cause a memory
leak but this is not certain, hence the extra logging for future
debugging.
Previously we assumed that a decrypted event has a room_id
but this isn't necessarily true for to_device events.
It makes sense to ignore events that aren't associated with
rooms anyway given that the list we're updating only contains
rooms!
To make sure that we handle rooms that our
client has not seen previously, we regenerate
the room list when the room is stored -
which is indicated by the js-sdk by the
Room event.
so that we can do reorderings of lists ordered by most recent event.
No optimisations here; we only update for timeline events
on live timelines that could update the "unread count".
Actually fixes vector-im/riot-web#6135 unlike #1748, which
incorrectly assumed that custom tags would be included in
listOrders.
This fix makes sure that the `default` case in the `switch`
is actually used.
by sending each tag_ordering with a _storeId and ignoring accout data
that has a matching _storeId.
This will tend to become out of sync with the server over time if
requests continually fail, but subsequent successful requests will
rectify any differences.
This new library handles the simple case of an ordered vertical
(or horizontal) list of items that can be reordered.
It provides animations, handles positioning of items mid-drag
and exposes a much simpler API to react-dnd (with a slight loss
of potential function, but we don't need this flexibility here
anyway).
Apart from this, TagOrderStore had to be changed in a highly
coupled way, but arguably for the better. Instead of being
updated incrementally every time an item is dragged over
another and having a separate "commit" action, the
asyncronous action `moveTag` is used to reposition the tag in
the list and both dispatch an optimistic update and carry out
the request as before. (The MatrixActions.accountData is still
used to indicate a successful reordering of tags).
The view is updated instantly, in an animated way, and this
is handled at the layer "above" React by the DND library.
so that shift-click semantics can work. The store that computes the shift-click
rules has to be aware of the actual order of tags displayed, so they must be done
in the same store.
Also, delete the groupProfilePromise immediately after setting
the group profile (the first if-statement will prevent a new
request from being started).