Skip to content

fix: Stop failover history from looping when reaching the end of results#1113

Merged
c-warren merged 4 commits intocadence-workflow:masterfrom
c-warren:cwarren/fixfailoverhistoryinfiniteload
Dec 11, 2025
Merged

fix: Stop failover history from looping when reaching the end of results#1113
c-warren merged 4 commits intocadence-workflow:masterfrom
c-warren:cwarren/fixfailoverhistoryinfiniteload

Conversation

@c-warren
Copy link
Contributor

Summary

When fetching failover history and reaching the end of results (a response of nextPageToken: "") the page would attempt to load the next page of results. An empty token/undefined token is assumed to be the first page by the server, which resulted in an infinite loop of results.

For a domain with no results, this exhibited as an infinite loading screen:

Screen.Recording.2025-12-10.at.13.09.10.mov

For a domain with some results, this exhibited as out of order results + an infinite scroll:

Screenshot 2025-12-10 at 13 09 33

Change

Tanstack already handles this by allowing a different definition of the initial parameter (in our case an empty string) and the request for subsequent pages (the nextPageToken from the response). This update ensures that the nextPageToken is only populated if it is a non-empty string.

For a domain with no results:

Screen.Recording.2025-12-10.at.13.13.36.mov

For a domain with some results:
Screenshot 2025-12-10 at 13 14 04

@c-warren c-warren merged commit cf827a5 into cadence-workflow:master Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants