Skip to content

fix(ui): retry the table list after a failed load - #119

Merged
kwrkb merged 4 commits into
mainfrom
fix/catalog-retry-after-load-failure
Oct 4, 2026
Merged

kwrkb merged 4 commits into
mainfrom
fix/catalog-retry-after-load-failure

Conversation

@kwrkb

@kwrkb kwrkb commented Oct 4, 2026

Copy link
Copy Markdown
Owner

#118 のマージ後レビューで見つかった問題の修正。

修正

内容 修正 コミット
起動時の Tables() が一度失敗すると、SELECT では再取得されない(#118 の Codex P2 指摘が未対応のままマージされていた) 失敗を sidebar.loadFailed に記録し、失敗が残っている間はクエリ種別を問わず再取得する。成功・接続切替でクリア c1ba867
e キーが列の有無を見るためだけに全行をソートし、エクスポート時に再ソートしていた ペイン選択を exportPane に分離し、e ではソートしない a8a68be
applyResultWithSort のセル幅フォールバックのコメントが、検出できる範囲(列数の変化のみ)を言い過ぎていた コメントを修正(挙動変更なし) a8a68be

#118 以前は次の SELECT で自然に回復していた。サイドバーには再読込キーがないため、DDL/DML か接続切替まで空のままになっていた。

テスト

  • TestQueryExecuted_RetriesTableLoadAfterFailure を追加(修正前のコードで FAIL することを確認済み)
  • go vet ./... / go test ./... / govulncheck ./...(0 件)

🤖 Generated with Claude Code

https://claude.ai/code/session_01XagFqrp1xwLFWV8NhqmSr4

kwrkb and others added 2 commits October 4, 2026 22:35
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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T13:42:35.236381Z 9a44599 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/ui/model.go Outdated
Comment on lines 618 to 621
if !m.sidebar.loadFailed && readonly.Check(msg.query) == nil {
return m, nil
}
return m, loadTablesCmd(m.activeDB(), m.connGen)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
@kwrkb
kwrkb merged commit 5dc0afa into main Oct 4, 2026
3 checks passed
@kwrkb
kwrkb deleted the fix/catalog-retry-after-load-failure branch October 4, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant