fix(table): preserve filters after query errors - #2899
Merged
Merged
Conversation
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.
Related issue
N/A — maintainer-reported and reproduced during this session; no issue was created.
Summary
Entering an invalid WHERE or ORDER BY expression while browsing a table replaced the result with an error page and unmounted the filter editors, leaving no way to correct the expression. Failed page results now retain the last successful table and its editors, and report the error through the existing inline error panel. Correcting or clearing the expression allows the next query to succeed.
The change covers HTTP responses and desktop stream completion, with a regression test for failure followed by recovery.
Affected surfaces
The shared frontend also handles desktop table browsing; no Java bridge or packaging changes.
Verification
chat2db-community-client):yarn install --frozen-lockfile --offline— passed in the PR worktree.yarn test:result-pagination— 12 tests passed, including the new failure/recovery case.yarn test:search-result-query-composer— passed.yarn test:i18n— passed.yarn lint— passed.yarn build:web:community --app_version=0.0.0— passed before handoff; includes the build prechecks and production bundle validation.git diff --check— passed.%asdareports an error while retaining both editors and the previous rows; changing toid = 1returns one row; clearing the filter returns all three. Consecutive filters and invalid/corrected ORDER BY expressions also recover. The editor DOM nodes remain mounted, request SQL matches the expressions, and the final browser console has no errors. The maintainer also tested and accepted the page.Risk and compatibility
successandmessagefields; database-specific execution is unchanged.Reviewer map
src/hooks/useViewTablePaging.tsrejects failed page responses before replacing visible data;src/hooks/viewTablePagingModel.tspublishes only successful completed stream results. Paths are underchat2db-community-client.%asdain WHERE, and press Enter. Both WHERE and ORDER BY editors must remain usable; correcting or clearing the expression must recover.Contributor declaration
AI assistance: OpenAI Codex investigated, implemented, reviewed, and tested this change. The maintainer manually verified the corrected page and requested this PR.