Skip to content

fix(connections): a URI connection saved without a name is named after the form's default host, not the URI #1257

Closed

Description

@ZhuchkaTriplesix

Problem

When a connection is created from a URI and the name field is left empty, each form names it differently, and Redis and MongoDB name it after the host field (default localhost), not the host in the URI.

Form URI typed Saved name Code
PostgreSQL postgresql://u:p@pg.example.com:5433/app PostgreSQL: pg.example.com:5433 ✅ lib/features/postgresql/postgresql_connection_form.dart:330-344
MySQL mysql://u:p@my.example.com:3307/app MySQL (URI) lib/features/mysql/mysql_connection_form.dart:248-252
Redis redis://:p@cache.example.com:6380 Redis localhost:6379 ❌ lib/features/redis/redis_connection_form.dart:210-213
MongoDB mongodb://u:p@mongo.example.com:27018/app MongoDB <host field>:<port field> (localhost:27017 by default) ❌ lib/features/mongodb/mongodb_connection_form.dart:319

The Redis and MongoDB names point at a server the connection does not use. With several URI connections, the sidebar shows identical names (Redis localhost:6379 for every one). MySQL's name is not wrong, but it tells nothing about the server.

Found while writing the connection-form e2e scenarios (#1050, #1256). Those tests check the URI in the secure store and do not assert the name, so they do not pin the current behaviour.

Scope

  • One rule for all four forms: with an empty name and a URI, the name is <Type>: <uri host>:<uri port> (port = the URI's or the type's default), as PostgreSQL does now.
  • Fall back to <Type> (URI) only when the URI has no host (e.g. a Mongo +srv URI without one, a malformed URI).
  • A shared helper for the URI host/port, instead of one per form.

Acceptance Criteria

  • MySQL, Redis and MongoDB name a URI connection after the URI's host and port.
  • Widget tests per form: URI typed, name empty → expected name.
  • The e2e form scenarios (test/e2e/01_connection_lifecycle/e2e_connection_form_test.dart) assert the name contains the URI's host.

Activity

  1. added
    bugSomething isn't working
    connectionsDatabase connections, URI parsing, pools
    uxUser experience, keyboard shortcuts and interactions
    P3Low priority / Polish & Enhancements
    on Oct 10, 2026
  2. added a commit that references this issue on Oct 10, 2026
  3. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1264 (merged into dev).

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

    P3Low priority / Polish & EnhancementsbugSomething isn't workingconnectionsDatabase connections, URI parsing, poolsuxUser experience, keyboard shortcuts and interactions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions