Fix after parameter on topic data pagination #1468
Merged
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.
When the topic data search gets enough results in less than the defined 0.5% topic data increment (merged in #1209), the after variable given by the backend response won't be used (never set in nextPage state).
Then pagination won't work because it will use an old value of the nextPage variable (the one we get after the 1st topic data request when you open the topic data screen).
Ex: I perform a search by the key and the first page is returned after looking into the first 0.46% of topic data.
When I try to navigate to the next page, AKHQ will display No data available. This is because the URL requested is wrong:
/ui/myCluster/topic/myTopic/data?sort=OLDEST&partition=All&searchByKey=XXX_C&after=/api/myCluster/topic/myTopic/data?after=0-50&partition=All&sort=OLDEST
instead of
/ui/myCluster/topic/myTopic/data?sort=OLDEST&partition=All&searchByKey=XXX_C&after=0-122_1-0_2-0
This fix will always add the after parameter in searchEnd and set the nextPage variable with this value