Repository navigation
fix: drop stale profile when a tab moves to SQLite - #964
Merged
Merged
Conversation
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
Open
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.
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
profileIdof the server it was on before. At the next startuseStartupReconnectreconnected 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
requestTabConnectionacceptsprofileId: null, passing it through tosetTabConnection, which already clears the profile onnull(fix: rebind orphaned tabs to the run connection #961). Omitting it still keeps the current one.useConnectionSwitchingattach()andSchemaTreeselectDatabase()passconn?.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 noprofileIdafterwards (fails without the fix), and one taken over by a new server gets that server's profile (a guard; it passed before). TheSchemaTreecall 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