Skip to content

fix(client): preserve selected result page size - #2750

Merged
openai0229 merged 1 commit into
mainfrom
fix/result-page-size-selection
Aug 24, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/result-page-size-selection

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Summary

Fix the Community SQL result pagination size selector reverting to 1000 after a new size is selected.

Root cause

The result toolbar updated its local React state and then scheduled SQL execution with setTimeout(0). The execution path read pagination through an imperative ref before the new state render was guaranteed to commit, so selecting 5000 could still send pageSize=1000. The response then copied the old execution parameters and reset the selector back to 1000.

Changes

  • Pass the selected { pageNo, pageSize } directly through the toolbar operation callback.
  • Remove the pagination imperative ref and the pagination-specific setTimeout race.
  • Persist the exact request snapshot, including the selected page size, in the returned result's executeSqlParams.
  • Ignore stale responses when multiple pagination requests overlap.
  • Add deterministic pagination resolution tests for page-size changes, page changes, and incomplete metadata.
  • Include the regression test in the Community frontend prebuild suite.

Expected behavior

  • Selecting 5000 immediately sends pageSize=5000 and resets to page 1.
  • Moving to another page preserves the current page size.
  • Refresh and subsequent pagination operations preserve the last successful request size.
  • A slower response from an older request cannot overwrite a newer pagination result.

Verification

  • Pagination regression tests: 3/3.
  • Result-set UI tests: 35/35.
  • Full Community frontend prebuild suite passed.
  • Community production Webpack build and bundle verification passed.
  • ESLint, Stylelint, i18n validation, and git diff --check passed.

@openai0229
openai0229 requested review from a team and Aias00 as code owners August 24, 2026 06:50
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 24, 2026
@openai0229
openai0229 merged commit b51b451 into main Aug 24, 2026
19 checks passed
@openai0229
openai0229 deleted the fix/result-page-size-selection branch August 24, 2026 07:40
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant