Commit 98d182b
committed
fix(timeline): reset live timeline on room re-navigation to prevent stale linked chain
When the user navigates away from a room, the list subscription may deliver a
limited:true response that appends a gap to the existing paginated chain
(T0\u2192T1\u2192T2\u2192live). On re-navigation the server does not resend initial:true
(room was already delivered via list), so onInitialRoomData never fired and the
stale chain was rendered in useTimelineSync, causing events to appear out of
order or anchored at the wrong position.
Fix: subscribeToRoom() adds the room to a pendingTimelineResets Set when it has
an existing timeline. onInitialRoomData (registered before SlidingSyncSdk in
attach(), so it fires first) checks the set and calls resetLiveTimeline() before
the active-room snapshot events are processed. Both operations land in the same
React render cycle, so there is no blank-screen window between the reset and the
fresh 50-event pa
When the user cd /Users/evie/git/Sable && cat > /tmp/commit_msg.txt << 'COMMIT_EOF'
fix(timeline): reset live timeline on room re-navigation to prevent stale linked chain
When the user navigates away from a room, the list subscription may deliver a
limited:true response that appends a gap to the existing paginated chain
(T0->T1->T2->live). On re-navigation the server does not resend initial:true
(room was already delivered via list), so onInitialRoomData never fired and the
stale chain was rendered in useTimelineSync, causing events to appear out of
order or anchored at the wrong position.
Fix: subscribeToRoom() adds the room to a pendingTimelineResets Set when it has
an existing timeline. onInitialRoomData (registered before SlidingSyncSdk in
attach(), so it fires first) checks the set and calls resetLiveTimeline() before
the active-room snapshot events are processed. Both operations land in the same
React render cycle, so there is no blank-screen window between the reset and the
fresh 50-event page appearing.
COMMIT_Efix(timeline): reset live timeline on room re-navigation to prevent s.t
Wh q'
git status1 parent 3146a71 commit 98d182b
1 file changed
Lines changed: 49 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
247 | 255 | | |
248 | 256 | | |
249 | 257 | | |
| |||
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
439 | 457 | | |
440 | | - | |
441 | 458 | | |
442 | | - | |
443 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
444 | 476 | | |
445 | 477 | | |
446 | 478 | | |
| |||
890 | 922 | | |
891 | 923 | | |
892 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
893 | 933 | | |
894 | 934 | | |
895 | 935 | | |
| |||
959 | 999 | | |
960 | 1000 | | |
961 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
962 | 1004 | | |
963 | 1005 | | |
964 | 1006 | | |
| |||
0 commit comments