Skip to content

fix(pg): closing schema browser tabs or stats view force-closes the shared read-only session #1237

Description

@ZhuchkaTriplesix

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

  • Closing PostgresIndexListView, PostgresTriggerListView, PostgresTypeListView, PostgresExtensionListView, PostgresFdwListView, or PostgresStatsView while loading does not call PostgresService.interrupt and leaves the shared session intact.
  • Existing tests pass without regressions.

Activity

  1. added
    bugSomething isn't working
    stabilityTheme parser epic label: stability
    coreCore library logic and services
    connectionsDatabase connections, URI parsing, pools
    P1High priority / Core capability
    on Oct 9, 2026
  2. added a commit that references this issue on Oct 9, 2026
  3. ZhuchkaTriplesix commented on Oct 9, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Closed by #1244.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority / Core capabilitybugSomething isn't workingconnectionsDatabase connections, URI parsing, poolscoreCore library logic and servicesstabilityTheme parser epic label: stability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions