-
-
Notifications
You must be signed in to change notification settings - Fork 313
fix(coordinator): resolve a table tab's schema from the active session when none is given #1808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,9 @@ extension MainContentView { | |
| } | ||
|
|
||
| private func consumePendingLoad(trigger: TableLoadTrigger, session: ConnectionSession) { | ||
|
Comment on lines
43
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a pending load resumes for a restored nil-schema table whose saved database differs from the connected session, this call stamps the schema before the code below switches to the tab's database. After the switch, Useful? React with 👍 / 👎. |
||
| if let tabId = tabManager.selectedTab?.id { | ||
| coordinator.resolveTableTabSchemaIfNeeded(tabId: tabId) | ||
| } | ||
| if let selectedTab = tabManager.selectedTab, | ||
| !selectedTab.tableContext.databaseName.isEmpty, | ||
| selectedTab.tableContext.databaseName != session.activeDatabase | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a table payload such as MCP
open_table_tabprovides adatabaseNamedifferent from the live session and omitsschemaName, this resolves nil against the pre-switch session schema.initializeAndRestoreTabslater switches toselectedTab.tableContext.databaseName, but the tab has already been stamped and its query built with the old schema, so openingdb_b.userswhile the session is ondb_a.salescan querydb_b.sales.usersinstead of the target database's default/current schema. Defer this fallback until after the database switch, or skip it when the payload database is not the active database.Useful? React with 👍 / 👎.