Commit 38057ee
committed
fix: reset live timeline on room navigation and reconnect
The Matrix SDK for sliding sync deliberately does not call resetLiveTimeline()
on limited:true (the handling is in a commented-out TODO block). This means
events from a previous visit remain in the live timeline and new events get
appended after them, with the backward pagination token pointing to the gap
between old and new events rather than to before all events. The result is
that new messages appear out of order or the gap is unreachable via the UI.
Two fixes:
1. useSlidingSyncActiveRoom: reset the live timeline synchronously before
the subscription request is sent on room navigation. This ensures the
fresh initial:true response populates a clean timeline, not one polluted
with events from the previous visit. Also removes the 100ms delay that
was added as an incomplete workaround for the same issue.
2. SlidingSyncManager.onLifecycle: in RequestFinished state (fires before
any room data listeners run), reset the live timeline for active-room
subscriptions that receive initial:true or limited:true. This covers the
reconnect/background case where the pos token expires and all active rooms
get a fresh initial:true in the same sync cycle.1 parent 9f45a73 commit 38057ee
2 files changed
Lines changed: 24 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 27 | + | |
| 28 | + | |
38 | 29 | | |
39 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
353 | 375 | | |
354 | 376 | | |
355 | 377 | | |
| |||
0 commit comments