Skip to content

pgModeler Plus 2.0 installer did not adopt newer existing user connection configs from 1.2 on macOS #2060

@tobieapb

Description

@tobieapb

Summary

On macOS, after reinstalling pgModeler Plus 2.0 over a system where the 2.0 alpha had been installed and tested before, the app continued using an older existing pgmodeler-2.0 preference set instead of adopting the newer and more complete connection configuration already present in pgmodeler-1.2.

This resulted in the 2.0 app loading stale database and SSH tunnel connection settings, while the 1.2 config set contained the newer canonical definitions.

Environment

  • OS: macOS
  • App bundle: pgModelerPlus.app
  • Bundle identifier: io.pgmodeler.pgModeler
  • Observed user preference directories:
    • ~/Library/Preferences/pgmodeler-1.0
    • ~/Library/Preferences/pgmodeler-1.2
    • ~/Library/Preferences/pgmodeler-2.0

Expected behavior

If a newer existing per-user config set contains newer connection definitions than the current 2.0 config set, the 2.0 installation or first run should either:

  1. migrate/import the newer connection settings automatically, or
  2. prompt the user to choose which existing config set to import, or
  3. at minimum avoid silently preferring stale 2.0 config files over newer 1.2 ones.

Actual behavior

This was not a clean first-time 2.0 install. An older ~/Library/Preferences/pgmodeler-2.0/ already existed from a previous 2.0 installation.

After reinstalling 2.0, the app used those older files already present in ~/Library/Preferences/pgmodeler-2.0/ even though ~/Library/Preferences/pgmodeler-1.2/ contained the newer and more complete connection definitions.

The 1.2 set had newer DB and SSH connection parameters, including:

  • PostgreSQL connection options="keepalives=1 keepalives_idle=60 keepalives_interval=10 keepalives_count=5"
  • SSH tunnel options -o ServerAliveInterval=60;-o ServerAliveCountMax=3
  • Additional tunnel/connection entries not present in the 2.0 set

Evidence

The canonical newer files were (newer files on older 1.2 version):

  • ~/Library/Preferences/pgmodeler-1.2/connections.conf
  • ~/Library/Preferences/pgmodeler-1.2/plugins/sshtunnel/sshtunnel.conf

The stale 2.0 files were (stale preferences from previous alpha testing ov 2.0 version):

  • ~/Library/Preferences/pgmodeler-2.0/connections.conf
  • ~/Library/Preferences/pgmodeler-2.0/plugins/sshtunnel/sshtunnel.conf

Differences observed (user specific extra parameters for the connections):

  • pgmodeler-1.2/connections.conf included database connection options="keepalives=..." attributes that were missing in pgmodeler-2.0/connections.conf.
  • pgmodeler-1.2/plugins/sshtunnel/sshtunnel.conf included SSH options -o ServerAliveInterval=60;-o ServerAliveCountMax=3, while pgmodeler-2.0/plugins/sshtunnel/sshtunnel.conf did not.
  • pgmodeler-1.2/plugins/sshtunnel/sshtunnel.conf also had an extra tunnel definition that was absent from the 2.0 set.

Reproduction idea

A likely trigger is:

  1. Have an existing ~/Library/Preferences/pgmodeler-2.0/ from an older install.
  2. Later update or continue using ~/Library/Preferences/pgmodeler-1.2/, adding newer database and SSH connection settings.
  3. Reinstall or relaunch pgModeler Plus 2.0.
  4. Observe that 2.0 keeps using the older pre-existing pgmodeler-2.0 files instead of migrating/importing the newer 1.2 definitions.

Likely cause

My inference is that migration/import behavior may only work when the target version directory is absent or blank, and may be skipped when ~/Library/Preferences/pgmodeler-2.0/ already exists.

If that is the current behavior, it would explain why a reinstall preserved stale 2.0 connection files instead of comparing them with newer available settings from 1.2.

Impact

Users can lose access to the latest working connection definitions after reinstalling 2.0, especially when SSH tunnel options or DB keepalive options were only present in the newer 1.2 preference set.

This is confusing because the machine already contains a newer working configuration, but 2.0 silently prefers the stale one.

Suggested fix

Consider adding startup migration logic for macOS preference directories so that when multiple versioned config directories exist, pgModeler:

  • detects the newest valid config set,
  • compares timestamps or config richness even when the current-version directory already exists,
  • offers import/migration into the current version directory, and
  • does not silently keep stale connection and tunnel definitions.

It would also help to expose a clear policy or setting for this behavior, with a sensible default, for example:

  • prefer the newest compatible config set,
  • prefer the existing current-version directory, or
  • prompt the user to choose when both exist.

Workaround used

Manual copy from the newer 1.2 config set into the 2.0 config set:

  • ~/Library/Preferences/pgmodeler-1.2/connections.conf -> ~/Library/Preferences/pgmodeler-2.0/connections.conf
  • ~/Library/Preferences/pgmodeler-1.2/plugins/sshtunnel/sshtunnel.conf -> ~/Library/Preferences/pgmodeler-2.0/plugins/sshtunnel/sshtunnel.conf

Verification after workaround

After manually copying the newer 1.2 files into the 2.0 preference directory:

  • the SSH tunnels established successfully in pgModeler Plus 2.0, and
  • the database export completed successfully without issues.

This confirms the newer 1.2 connection and SSH tunnel configs were the correct working set, and that the problem was the 2.0 app continuing to use stale existing 2.0 preference files instead of the newer available configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions