Skip to content

bug(connections): URL parser stores default port even when URI omits the port #258

Description

@ZhuchkaTriplesix

connection_url_parser.dart reads uri.port unconditionally on line 89. If the URI omits the port, uri.port returns the scheme's default port, which is correct for postgresql/postgres (5432), but the code does not explicitly check uri.hasPort. This is fragile if other schemes are added or if Uri behavior changes.

Impact: Persisted port can be 5432 even when not specified, which is mostly harmless but inconsistent with how the form handles omitted ports.

Expected: Only store port when uri.hasPort is true; otherwise leave it null and rely on driver defaults.

Acceptance criteria:

  • Use uri.hasPort before assigning uri.port.
  • Ensure stored default does not conflict with driver defaults.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions