mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-25 19:41:17 -08:00
### Description Fixes several timeline bugs introduced after the timeline-reset-on-navigation refactor: - Scroll-to-bottom no longer gets stuck after navigating to a room - Timeline pagination no longer uses a stale timeline chain after a sliding sync reset - URL preview requests are deduplicated so the same URL only fires one network request - Removed a redundant spidering call that was generating an extra sliding sync request per room visit Fixes # #### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings ### AI disclosure: - [x] Partially AI assisted (GitHub Copilot) `RoomTimeline.tsx`: Added a `liveTimelineLinked` guard so the initial scroll doesn't fire with stale data from the previous room, and a `pendingReadyRef` that defers `setIsReady(true)` when `processedEvents` is still empty (preventing the room opening at position 0). `useTimelineSync.ts`: A `useEffect` resets the timeline state on room change so revisited rooms aren't stuck with `liveTimelineLinked = false`. Reads `linkedTimelines` fresh after each `await` in pagination so a sliding sync reset mid-paginate doesn't cause count comparisons on a detached chain. A `continuing` flag prevents two concurrent pagination calls from racing on the lock. URL preview dedup uses a module-level `Map` to share in-flight promises for the same URL. Removed a redundant `startSpidering` subscription call in the sync setup path.