Skip to content

fix: drop stale profile when a tab moves to SQLite - #964

Merged
EVWorth merged 1 commit into
devfrom
claude/relaxed-edison-8gs7dq
Nov 11, 2026
Merged

EVWorth merged 1 commit into
devfrom
claude/relaxed-edison-8gs7dq

Conversation

@EVWorth

@EVWorth EVWorth commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Problem

A query tab that a newly opened SQLite file takes over (because the tab's own server is gone or it had none), or that is moved to a SQLite file from the schema tree, kept the profileId of the server it was on before. At the next start useStartupReconnect reconnected that profile and bound the tab back to the old server. #961 fixed this for the rebind that happens on Run; this is the other route.

Change

  • requestTabConnection accepts profileId: null, passing it through to setTabConnection, which already clears the profile on null (fix: rebind orphaned tabs to the run connection #961). Omitting it still keeps the current one.
  • useConnectionSwitching attach() and SchemaTree selectDatabase() pass conn?.profile_id ?? null, so a target with no profile clears the tab's instead of keeping it.

Tests

useConnectionSwitching.test.ts: a tab whose server is gone and that a SQLite file takes over has no profileId afterwards (fails without the fix), and one taken over by a new server gets that server's profile (a guard; it passed before). The SchemaTree call site has no test of its own.

Gates run locally via the pre-commit hooks: dprint, npm run lint, npm run type-check, npm run test:unit. No browser test covers the changed lines; the browser suite was not run.

Closes #962


Generated by Claude Code

A tab taken over by a newly opened SQLite file, or moved to one from the
schema tree, kept the profile of the server it was on, so the next start
reconnected that server and bound the tab back to it.

Closes #962

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tzYxya6Umczq4EBPTYkX4
@EVWorth
EVWorth merged commit be30f8a into dev Nov 11, 2026
15 checks passed
@EVWorth
EVWorth deleted the claude/relaxed-edison-8gs7dq branch November 11, 2026 00:55
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
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.

fix: tab keeps old server profile when moved to SQLite

2 participants