fix(ui): ListWatch
should not _both_ set and depend on nextOffset
#12672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #12663, fixes #12626 (as well as #12025 (comment) 2.i, the one with the browser network tab screenshot)
Follow-up to #11891
Motivation
The
ListWatch
previously both depended on and setnextOffset
, which was recursivelist
uses the wholepagination
object, butnextOffset
only changes within the effect or at the same time as another paginationnextOffset
stayed consistent. would have two for each page movenextOffset
is constant after the duplicatelistWatch.stop()
would not stop themlistWatch.stop()
was occurring (through logs and other debugging), it just seemed to not close the SSE for some reason (???)Modifications
remove
nextOffset
from theListWatch
'suseEffect
's deps arrayalso fix a typo I had in the query param retrieval of
offset
name
instead of putting the actual name of the param,offset
, woops 😕plus consistently ensure that the pagination defaults are
undefined
everywhere, so that theuseEffect
deps do not changeVerification
In my partial repro, the network waterfall looked like the below, with duplicate SSEs that were not always cancelled:
After this fix, it now looked as intended, only one SSE at a time: