matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

fix(sdk): `OrderTracker` is getting out of sync

Open Hywan opened this issue 1 month ago • 1 comments

In EventLinkedChunk::reset, the OrderTracker isn't reset properly:

https://github.com/matrix-org/matrix-rust-sdk/blob/aa79e347944703f1d49e8787264792e27931334c/crates/matrix-sdk/src/event_cache/room/events.rs#L78-L84

which then later can create an error in linked_chunk::AsVector:

https://github.com/matrix-org/matrix-rust-sdk/blob/aa79e347944703f1d49e8787264792e27931334c/crates/matrix-sdk-common/src/linked_chunk/as_vector.rs#L492-L499

Hywan avatar Nov 25 '25 09:11 Hywan

So, after further digging, OrderTracker will receive its updates from self.chunks.clear(), which means it doesn't need to be reset. We have a bug though, see https://sentry.tools.element.io/organizations/element/issues/11218915/?project=63&query=is%3Aunresolved&statsPeriod=14d&stream_index=15

Hywan avatar Nov 25 '25 10:11 Hywan