Skip to content

Conversation

@Assem-Uber
Copy link
Contributor

@Assem-Uber Assem-Uber commented Nov 3, 2025

Summary
Use new fetcher hook in the history page. This replaces old logic of useKeepLoadingEvents hook which depends on the render cycle completion to start fetching the next page. The new hook allows throttle query data updates and render once after few requested pages.

Changes

  • Replace existing useSuspenseInfiniteQuery with the new fetcher hook
  • Replace the existing useKeepLoadingEvents with usage for start/stop methods from fetcher
  • Delete useKeepLoadingEvents as it is no longer used.
  • Misc: Fix a type for header export button arg (it had extra fields than it needs)

Recording
Using custom buttons to validate start/stop/error of the fetcher on the history page.
The start/pause/error buttons are for testing purposes

Tested scenarios:

  • Stop start manually using buttons
  • Tested errors in API requests and handling retries
  • Tested loading more by scrolling
  • Tested recovering from errors by scrolling to the end of the page
Screen.Recording.2025-11-03.at.11.07.09.mov

Risks
If fetcher is problematic, loading more pages may not happen. Ending up with a partially fetched history.

Assem-Uber and others added 7 commits November 3, 2025 09:56
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Assem-Uber and others added 7 commits November 6, 2025 03:02
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
Signed-off-by: Assem Hafez <assem.hafez@uber.com>
@Assem-Uber Assem-Uber merged commit 4c6b6a1 into cadence-workflow:master Nov 10, 2025
6 checks passed
@Assem-Uber Assem-Uber deleted the feature/15952/use-fetcher-in-workflow-history-page branch November 10, 2025 13:24
Assem-Uber added a commit to Assem-Uber/cadence-web that referenced this pull request Nov 19, 2025
* Create fetcher utility

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename query

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* add configurable throttleMs to the hook

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* use fetcher in workflow history

* remove useKeepLoadingEvents

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update fetcher based on feedback

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* rename unmout to destroy

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* Create hook for fetching history

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* move condition into executeImmediately

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* update destroy in method

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

* fix type error with query params

Signed-off-by: Assem Hafez <assem.hafez@uber.com>

---------

Signed-off-by: Assem Hafez <assem.hafez@uber.com>
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