Repository navigation
FIX: stop the findings export when a page offset repeats - #4008
Merged
Roman Lutz (romanlutz) merged 2 commits intoNov 8, 2026
Merged
Roman Lutz (romanlutz) merged 2 commits into
Roman Lutz (romanlutz) merged 2 commits into
Conversation
A server answer whose next offset does not advance left the export loop fetching the same page forever with the dialog stuck loading. The loop now remembers seen offsets and stops with an error naming the problem, and the error path surfaces the message when the API error carries no detail. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Contributor
|
The visible change is in the repeated-offset error path, not the normal dialog layout. These screenshots show the actual export dialog with synthetic findings and a controlled page response of Before: the dialog stays on "Loading findings..." and continues requesting the same page. After: it shows "Could not load findings: The findings page offset did not advance." with Retry after one request. |
Roman Lutz (romanlutz)
approved these changes
Nov 8, 2026
toApiError already returns the message of a plain Error, or a fixed message when it is empty, and its detail is never undefined, so the fallback could not run. The repeated offset error reaches the dialog through toApiError on its own. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
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.


Description
Fixes #4007
The export dialog loads every finding through a while loop over
next_offset. When the server answershas_more: truewith an offset that does not advance, the loop fetches the same page forever: the dialog stays on loading findings with no error and no way out except closing it. The codebase's own pagination helper documents this exact hazard and guards it with a seen cursor set and a page cap; the export loop had neither.The loop now remembers every offset it has fetched and stops with an error naming the non advancing offset the moment a page repeats it. The guard throws a plain Error, and the existing error path already turns that into its message through toApiError, so the dialog shows it next to Retry.
Tests and Documentation
Added a regression whose list endpoint always returns the same offset: the dialog now shows the did not advance error after exactly one fetch instead of looping; it fails on main, where the loop never terminates. The full export suite passes at 25 tests and tsc is clean.
No documentation change needed, so I did not run JupyText.