fix(frontend): stabilize admin execution pagination bar#6050
Open
Raja-Hamid wants to merge 1 commit into
Open
Conversation
The admin Executions page re-ran its full query every second via setInterval(ngOnInit) while driving a manual server-side pager, so the page-number bar jumped and raced user clicks — unlike every other list. - Replace the 1s self-refresh with a 1s client-side time tick plus a 5s switchMap-cancelled poll that never touches page index/size and only updates the total when it changes. - Rewrite onQueryParamsChange to read page size and index together and clamp into range (order-independent), fixing desync on size changes. - Refresh promptly after kill/pause/resume. Closes apache#3586
Contributor
|
👋 Thanks for your first contribution to Texera, @Raja-Hamid! If you're looking for a good place to start, browse issues labeled You can drive common housekeeping yourself by commenting one of these commands on its own line:
Each command must match exactly: |
Contributor
Automated Reviewer SuggestionsBased on the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this PR?
The Admin → Executions page had an inconsistent, "jumpy" page-number bar compared to every other list in the app (#3586).
Root cause. It was the only paginated page that re-ran its entire query every second via
setInterval(() => this.ngOnInit(), 1000)while driving a manual server-side pager ([nzFrontPagination]="false"with bound[nzPageIndex]/[nzPageSize]/[nzTotal]). Every tick reassigned the data and total under the pager, with no request cancellation, so the bar reshuffled every second and raced the user's clicks. Separately,onQueryParamsChangeused anelse-ifthat dropped the page index whenever the page size changed, desyncing the highlighted page from the data.Fix (frontend-only,
admin-execution.component.ts):updateTimeStatus()); data is refreshed by a decoupled 5sswitchMap-cancelled poll that refetches only the current page, never touches page index/size, and updates the total only when it actually changed.onQueryParamsChangeto read page size and index from every event and clamp the page into range (order-independent) — fixing the size-change desync and the out-of-range/empty cases.fetchData()(user-initiated) andfetchCurrentPage()(background/silent); kill/pause/resume now trigger a prompt refresh instead of waiting for the next tick.Before: the bar flickered/reshuffled every second and could jump on click or page-size change.
After: the bar is stable when idle, follows clicks, re-centers predictably, and clamps correctly on page-size change — consistent with the rest of the app (e.g. Admin → Users).
Any related issues, documentation, discussions?
Closes #3586
How was this PR tested?
Unit tests (Vitest) — added 8 cases in
admin-execution.component.spec.tscovering first/last page, page-size change, order-independent size+index change, single-page, empty results, and no-double-fetch on sort/filter:corepack yarn ng test --watch=false --include="**/admin-execution.component.spec.ts"
→ 10/10 passing (8 new + 2 existing). Three of the new cases were red against the old code (page-size-change desync, order-independent size+index change, empty-results clamp) and green after the fix.
Manual — ran the
bin/single-nodestack +ng serve, seeded ~65 workflows/executions, and verified on Admin → Executions that the page bar follows clicks, re-centers, stays idle-stable, and clamps on page-size change; compared side-by-side against Admin → Users (built-in pager) — now consistent.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Yes, alongside Claude Code