fix(ui): enforce pagination limit on workflow-list watch stream. Fixes #16013#16017
Open
alliasgher wants to merge 1 commit intoargoproj:mainfrom
Open
fix(ui): enforce pagination limit on workflow-list watch stream. Fixes #16013#16017alliasgher wants to merge 1 commit intoargoproj:mainfrom
alliasgher wants to merge 1 commit intoargoproj:mainfrom
Conversation
…argoproj#16013 The ListWatch initial list() call respects the pagination limit, but the watch SSE stream appends every ADDED event unbounded, so the workflow list grew past the 'Results per page' setting as new workflows were created. Add an optional limit to ListWatch and slice after each watch event when present. Pass pagination.limit from the workflows list caller. Other ListWatch callers are unaffected since the new parameter is optional. Signed-off-by: Ali <alliasgher123@gmail.com>
4 tasks
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.
Fixes #16013
Motivation
On the Workflow List page, the initial
services.workflows.list()call respects thepagination.limit(e.g. "Results per page" = 5), but the SSE watch stream feeds every ADDED event intoListWatch.mergeItem()unbounded. As new workflows are created or the admin cluster churns, the displayed list grows past the page-size setting (5 → 12 → 30 → 50+).Modifications
limitparameter toListWatch<T>; after each watch event, if the merged list exceedslimit, truncate to the firstlimititems. The list is already sorted by the caller'ssorter(youngest first for workflows), so we keep the youngest N.pagination.limitthrough fromworkflows-list.tsxinto theListWatchconstructor.ListWatchcallers (event-flow, events-panel) are unaffected — the parameter is optional.Verification
node_modules/typescript/bin/tsc --noEmitclean for the two touched files.eslint --fixclean for the two touched files.Documentation
No doc changes — this restores intended behavior on an existing, documented setting (Results per page).
AI
This PR (code and description) was drafted with Claude (Anthropic) under human review, per the Argo project Generative AI policy.