Open ara4n opened 7 months ago
The Clear
is “normal“ because the server replies with a limited
flag. With EventCache
coming, we won't need to clear the timeline anymore.
We assign new unique_ids to the same items (probably not a disaster given we just Cleared the previous ones), but it's unsetlling to see the same items turning up with different ids.
I've checked this one because this shouldn't happen anymore. If it does, please provide a code example showing how to trigger it. The unique IDs are about to gain in importance with #4093, so we need them to be super-stable.
I just had a go at implementing the timeline API in my experimental rust-sdk on Web test jig (aurora). I'm seeing very strange behaviour, which maps onto reported bugs on Element X. If I use the API via:
Then I get the following behaviour:
items
returns an up-to-date array of date sep + the most recent ~6 items in the timeline, with unique_ids 0..6diff
then yields:Clear
(which deletes them all)PushBack
of the date sep (with unique_id 7)PushBack
of the most recent item in the timeline (with a new unique_id of 8, rather than 6 as it was before the clear)PushBack
s of the previous 10 messages (meaning the timeline is now out of order), mixed with lots ofSet
as the items are gradually built up with RRsRemoveItem
at index 1 to remove the out-of-order itemPushBack
to add it back (with unique_id 8) at the right point at the end.In other words, the bugs are:
items
). This is presumably the cause of https://github.com/element-hq/element-x-ios/issues/1895c.f. https://github.com/matrix-org/matrix-rust-sdk/issues/1103 for known limitations of the timeline API, which doesn't look to include these.