Skip to content

fix(host): keep per-host overrides from becoming the app-wide default - #11

Open
andreas-byfut wants to merge 1 commit into
LordOfPolls:masterfrom
andreas-byfut:fix/host-override-not-default
Open

andreas-byfut wants to merge 1 commit into
LordOfPolls:masterfrom
andreas-byfut:fix/host-override-not-default

Conversation

@andreas-byfut

Copy link
Copy Markdown
Contributor

The app-wide terminal profile and colour scheme are the lowest-id rows in their tables, and
Settings only inserts them on the first edit. If a host's first override was enabled before that,
the override became the lowest-id row, and every host picked it up as the default.

TerminalProfileDao.insertOverride() and ColorSchemeDao.insertOverride() now insert the default
row first when none exists, then the override, in one @Transaction. There is no schema change.

Known limit: installs where an override already became the default are not repaired. The override
cannot be told apart from a deliberately edited default.

Tests: InsertOverrideTest.

The app-wide terminal profile and colour scheme are the lowest-id rows,
and Settings only inserts them on the first edit. Creating a host's
first override before that inserted it as the lowest-id row, so every
host picked it up as the default. insertOverride() on both DAOs now
writes the default row first when it is missing, then the override, in
one transaction.
@andreas-byfut andreas-byfut changed the title fix(host): keep per-host overrides from becoming the app-wide default fix(host): keep per-host overrides from becoming the app-wide default Nov 13, 2026
@LordOfPolls

Copy link
Copy Markdown
Owner

Thanks. Good fix. This will resolve for new installs, however pre-existing isntalls stay broken.
Suggest adding a @transaction cleanup to each DAO. It should copy that row from the hsot and point the host at the copy, leaving default values alone.
Run it at startup and after import. One test is enough - that resolves your known limit line

@LordOfPolls LordOfPolls added bug Something isn't working needs-revision labels Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants