Part of #1212. Follow-up to #1215 and #1236.
Problem
Closing any of the PostgreSQL schema object browser views or the stats view while loading force-closes the shared readOnly session of the database.
In lib/features/postgresql/postgres_browser_views.dart:
PostgresIndexListView.dispose() (lib/features/postgresql/postgres_browser_views.dart:51)
PostgresTriggerListView.dispose() (lib/features/postgresql/postgres_browser_views.dart:231)
PostgresTypeListView.dispose() (lib/features/postgresql/postgres_browser_views.dart:403)
PostgresExtensionListView.dispose() (lib/features/postgresql/postgres_browser_views.dart:555)
PostgresFdwListView.dispose() (lib/features/postgresql/postgres_browser_views.dart:701)
In lib/features/postgresql/postgres_stats_view.dart:
PostgresStatsView.dispose() (lib/features/postgresql/postgres_stats_view.dart:69)
All 6 views contain:
if (_loading) {
PostgresService.instance.interrupt(
widget.connectionRow,
database: widget.database,
mode: PgSessionMode.readOnly,
);
}
PostgresService.instance.interrupt removes the pooled entry and calls forceClose() on the shared connection. That connection is shared with the object tree, open table tabs, ERD/relations view, other browser views and MCP calls.
Effects:
Scope
Acceptance
Part of #1212. Follow-up to #1215 and #1236.
Problem
Closing any of the PostgreSQL schema object browser views or the stats view while loading force-closes the shared
readOnlysession of the database.In
lib/features/postgresql/postgres_browser_views.dart:PostgresIndexListView.dispose()(lib/features/postgresql/postgres_browser_views.dart:51)PostgresTriggerListView.dispose()(lib/features/postgresql/postgres_browser_views.dart:231)PostgresTypeListView.dispose()(lib/features/postgresql/postgres_browser_views.dart:403)PostgresExtensionListView.dispose()(lib/features/postgresql/postgres_browser_views.dart:555)PostgresFdwListView.dispose()(lib/features/postgresql/postgres_browser_views.dart:701)In
lib/features/postgresql/postgres_stats_view.dart:PostgresStatsView.dispose()(lib/features/postgresql/postgres_stats_view.dart:69)All 6 views contain:
PostgresService.instance.interruptremoves the pooled entry and callsforceClose()on the shared connection. That connection is shared with the object tree, open table tabs, ERD/relations view, other browser views and MCP calls.Effects:
Not connected to PostgreSQL.Scope
if (_loading) PostgresService.instance.interrupt(...)fromdispose()across all 5 views inpostgres_browser_views.dartandPostgresStatsViewinpostgres_stats_view.dart.dispose()should only release the acquired lease (_lease?.release()), matching the pattern established for tables (fix(db): closing a table tab force-closes the read-only session other views are using #1215) and routine/sequence views (fix(pg): closing a sequence or routine view releases its lease without interrupting the shared session (#1215) #1236).Acceptance
PostgresIndexListView,PostgresTriggerListView,PostgresTypeListView,PostgresExtensionListView,PostgresFdwListView, orPostgresStatsViewwhile loading does not callPostgresService.interruptand leaves the shared session intact.