Skip to content

Conversation

@jerryzhou196
Copy link
Member

@jerryzhou196 jerryzhou196 commented Oct 14, 2025

When building the background refresh, Billy and I encountered some bugs with useFetchParallelPages.

a. It doesn't refetch with a different hits value:

  1. (First call) useFetchParallelPages({hits = 12, perPage = 100}), then we would have pages=1
  2. (Second call) useFetchParallelPages({hits = 15, perPage = 100}), then we would still have pages=1 and the old version of cursors. The useEffect later wouldn't run fetch() on re-render when it should.

@linear
Copy link

linear bot commented Oct 14, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 14, 2025
@jerryzhou196 jerryzhou196 changed the title replay 553 fix use fetch parallel pages replay 553 - fix use fetch parallel pages Oct 14, 2025
@ryan953 ryan953 self-requested a review October 14, 2025 23:13
Copy link
Member

@ryan953 ryan953 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mean that we're getting into the useMemo more often (because hits will change more often than pages did) and thus we'll get a new array to process!

LG!

@jerryzhou196 jerryzhou196 changed the title replay 553 - fix use fetch parallel pages fix(replay) - fix use fetch parallel pages Oct 15, 2025
@jerryzhou196 jerryzhou196 merged commit 7e5a3d0 into master Oct 15, 2025
47 checks passed
@jerryzhou196 jerryzhou196 deleted the replay-553-fix-use-fetch-parallel-pages branch October 15, 2025 15:02
jerryzhou196 added a commit that referenced this pull request Oct 22, 2025
1. Makes the refresh button only reload what's necessary instead of a
full-page refresh.
2. Refactors `usePollReplayRecord` to return the `replayRecord` instead
of just `count_segments`
3. Removes `useIsLive` hook and determines LIVE by checking if polled
Date.now() < `replayRecord.finished_at()` + 5 minutes
4. Adds tests for `usePollReplayRecord` and the refresh button

before|after
--|--

![before](https://github.com/user-attachments/assets/36a1f807-7ce3-46a7-a1e7-df79c7fd8147
)|![after](https://github.com/user-attachments/assets/33546e08-74f5-4daf-835d-0b201bf96710)

requires #101462

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: ryan.albrecht <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants