Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(datagrid): cancel in-progress query before Cmd+R refresh#1650

Open
J2TeamNNL wants to merge 1 commit into
TableProApp:main from
J2TeamNNL:fix/datagrid-d14-refresh
Open

fix(datagrid): cancel in-progress query before Cmd+R refresh #1650
J2TeamNNL wants to merge 1 commit into
TableProApp:main from
J2TeamNNL:fix/datagrid-d14-refresh

Conversation

@J2TeamNNL

@J2TeamNNL J2TeamNNL commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Root cause

currentQueryTask?.cancel() initiates cooperative cancellation but does not synchronously reset tab.execution.isExecuting. The subsequent runQuery() call hits guard !tab.execution.isExecuting else { return } and silently bails, so the refresh never executes when a query is running.

Fix

After currentQueryTask?.cancel(), immediately set currentQueryTask = nil and reset tab.execution.isExecuting = false before calling rebuildTableQuery + runQuery. Applied to both the discard-confirmation branch and the no-pending-changes branch of handleRefresh.

File: TablePro/Views/Main/Extensions/MainContentCoordinator+Refresh.swift

Test plan

  • Open a table, start a slow query, press Cmd+R before it finishes — query cancels, fresh result loads
  • Same scenario with unsaved edits: confirm discard, then Cmd+R produces fresh results

chatgpt-codex-connector[bot] reacted with eyes emoji
...s runs
currentQueryTask?.cancel() is async; runQuery() bails on isExecuting == true.
Fix: nil the task and reset isExecuting synchronously before rebuildTableQuery + runQuery.

Copy link
Copy Markdown

💡 Codex Review


P2 Badge Call driver cancellation before restarting refresh

When Cmd+R is pressed while a table query is still running in the database driver, this clears currentQueryTask before runQuery() reaches executeQueryInternal. That method only calls driver.cancelQuery() inside if currentQueryTask != nil (TablePro/Views/Main/MainContentCoordinator.swift:1036-1043), so the backend query is never cancelled; it can keep occupying the connection and later unwind the cancelled task while the fresh query is already running. Keep the task reference long enough to invoke the existing cancellation path, or explicitly call cancelQuery() here before setting it to nil.

i️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /