Repository navigation
fix(ui): retry the table list after a failed load - #119
Conversation
Since #118 a read-only query no longer reloads the table list. A load that failed — a timeout on a large catalog at connect, a dropped connection — was then never retried short of a write or a connection switch, leaving the sidebar and table-name completion empty; before, the next SELECT healed it. Record the failure and reload after any query while it stands. (Codex review on #118, unaddressed before merge) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4
`e` called exportSource only to see whether the pane had columns, which sorted every row and then sorted again on export. exportPane picks the pane alone. Also say plainly that the cell-width fallback in applyResultWithSort only notices a change in column count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8a68be744
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !m.sidebar.loadFailed && readonly.Check(msg.query) == nil { | ||
| return m, nil | ||
| } | ||
| return m, loadTablesCmd(m.activeDB(), m.connGen) |
There was a problem hiding this comment.
Mark the table-list retry as in flight
After a failed table load, if two successful SELECTs finish before the first retry's Tables() call returns, loadFailed remains true and both completions launch concurrent retries. Because these requests share only connGen, a newer retry can succeed and populate the sidebar, then an older retry can fail later and incorrectly restore the failure state and error status, causing further redundant catalog queries. Clear/replace the failure flag when scheduling a retry, or add a per-load sequence/in-flight guard so only the latest retry may update this state.
Useful? React with 👍 / 👎.
With the retry after a failed load, two queries finishing while a retry is out start two loads on one connection. connGen cannot tell them apart, so an older failure landing after a newer success put back the failure state and its error status, and a late success could put back a stale list. Each load now carries sidebar.loadSeq and only the newest one is applied. (Codex review on #119) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4
#118 のマージ後レビューで見つかった問題の修正。
修正
Tables()が一度失敗すると、SELECT では再取得されない(#118 の Codex P2 指摘が未対応のままマージされていた)sidebar.loadFailedに記録し、失敗が残っている間はクエリ種別を問わず再取得する。成功・接続切替でクリアeキーが列の有無を見るためだけに全行をソートし、エクスポート時に再ソートしていたexportPaneに分離し、eではソートしないapplyResultWithSortのセル幅フォールバックのコメントが、検出できる範囲(列数の変化のみ)を言い過ぎていた#118 以前は次の SELECT で自然に回復していた。サイドバーには再読込キーがないため、DDL/DML か接続切替まで空のままになっていた。
テスト
TestQueryExecuted_RetriesTableLoadAfterFailureを追加(修正前のコードで FAIL することを確認済み)go vet ./.../go test ./.../govulncheck ./...(0 件)🤖 Generated with Claude Code
https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4