Skip to content

fix(web): the version says who updates FTW when the host does - #1863

Merged
frahlg merged 2 commits into
masterfrom
1784-ha-version-button
Nov 11, 2026
Merged

frahlg merged 2 commits into
masterfrom
1784-ha-version-button

Conversation

@frahlg

@frahlg frahlg commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Closes #1784.

Problem

In the Home Assistant app (v0.154.2-beta.1), clicking the version does nothing. That is true of both the version pill in the header (in the menu at phone width) and the Version button under More. Both call badge.open().

Cause

The HA app runs Core without the launcher (FTW_SELFUPDATE_ENABLED=0, FTW_BUNDLE=home_assistant_addon). Deps.SelfUpdate stays nil, so /api/version/check answers 503 {"error":"self-update disabled"}. <ftw-update-badge> took that answer as a reason to shut itself down (_disable()):

  • it hid itself, and open() returned at once;
  • the inline bridge in index.html removed the click from the version pill.

The pill keeps its border, like the buttons beside it, so it still looks like a button. The same shutdown also hid the header's connection light and the optimizer warning, which live in that badge. Docker installs without the launcher had the same problem.

Fix

  • After self-update disabled, the badge stops asking about versions but keeps running (_manageByHost(), _hostManaged).
  • Its marks render as before: connection light, connection lost, optimizer warning. There is no update mark. The green light's title is "Connected", not "Connected, nothing pending": the box cannot know what the host has waiting.
  • open() shows a short dialog: the running version from /api/components, then
    • HA app: "Home Assistant installs updates and rollbacks for this app." and the app version;
    • other installs: "FTW does not update itself here. Update it the way it was installed, for example with Docker."
      Until /api/components answers, it says only "FTW does not update itself here.", which is true of every install that lands here. It has only a Close button: no check, no update.
  • index.html no longer removes the click. The More button's subtitle reads "Running version and updates" instead of "… and published releases". The update-badge.js cache key moves to host1.
  • Native installs keep the same path; they never get this 503.

Settings › System already says Home Assistant manages updates. The dialog says the same thing where the user clicked.

Reproduce

  1. Build Core from master and run it as the HA app's run.sh does: FTW_SELFUPDATE_ENABLED=0 FTW_BUNDLE=home_assistant_addon FTW_BUNDLE_VERSION=0.157.0-beta.1 ftw -config … -web web.
  2. Open the UI and click the version pill in the header, in the menu at phone width, or Version under More.

Before: nothing happens. /api/version/check answers 503, <ftw-update-badge> is hidden, and the header has no connection light.
After: the dialog below opens, Close shuts it, and the green light is back.

Screenshots

Local Core in HA mode, localhost, desktop and 375 px.

Before (master): the pill looks like a button, no light beside it, a click does nothing After: the green light is back, a click opens the dialog

after the click
Phone width: header menu Phone width: More › Version

The light theme was also checked; the dialog uses the same styles as the native version dialog.

Tests

  • web/update-dialog.test.mjs: with the HA bundle, the dialog names the version and Home Assistant, has no update or check button, sends no further /api/version/* request, and Close removes it. Without a bundle it gives the Docker wording. Before /api/components answers, it names no host.
  • web/header-status-marks.test.mjs: after the 503 the badge stays visible with the green light titled "Connected", shows the optimizer warning when a late /api/components says the optimizer is unhealthy, and shows the offline mark when the connection drops. index.html no longer removes the click.
  • Both files failed before the fix (5 failing tests) and pass after it.
  • npm test: 896 of 896 pass. make verify ("vet + test + build clean") on the first commit; the review commit changes only web files and their tests.
  • Checked in the built-in browser as above.

Review

An independent review (Sonnet subagent) traced the native, Docker and boot-phase "starting" paths and found no regression. It also checked that a late /api/components response cannot reopen a closed dialog. Taken from it, in the second commit:

  • the green light no longer claims "nothing pending" where the host updates FTW;
  • no Docker hint for an HA user before /api/components answers;
  • the More button subtitle.

For Fredrik to confirm: #701 hid the whole badge when self-update is off. This PR shows the connection light and the optimizer warning again on HA and Docker installs, since a hidden "Connection lost" mark helps nobody. Say if you want that split out or reverted.

🤖 Generated with Claude Code

frahlg and others added 2 commits October 26, 2026 11:22
In the Home Assistant app and Docker, Core has no self-updater and
/api/version/check answers 503 "self-update disabled". The update badge
took that as a reason to shut itself down: it hid itself, stopped
answering open(), and the inline bridge removed the click from the
version pill. The pill still looked like a button, so a click did
nothing (#1784). The connection light and the optimizer warning, which
live in the same badge, were hidden too.

The badge now stops asking about versions but keeps working. Its marks
still show, and open() shows a dialog with the running version and who
updates it: Home Assistant for the app, the install method otherwise.
It offers no update or check button there.

Closes #1784

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From review. Where the host updates FTW, the green light now says
"Connected", not "Connected, nothing pending": the box cannot know what
the host has waiting. Until /api/components says how FTW was installed,
the dialog says only that FTW does not update itself here, so a Home
Assistant user never sees the Docker hint. The Version button under More
opens the same dialog; its subtitle now reads "Running version and
updates".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:54:37.464193Z ac08060 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes the version badge and the Version button useful when the host updates FTW (HA app, Docker): the dialog now says what runs and who updates it, and the header keeps the connection light and optimizer warning. Fixes #1784.

  • Security: no new deps, no new network hosts. The dialog HTML interpolates version and bundle.version through escapeHTML; the rest is static strings. Fine.
  • Correctness: _hostManaged guards _refresh and _startUpdate, so no update call can fire on a host-managed install. Tests updated to match.
  • Nit: the 'Connected' dot says nothing about pending host updates. The comment already admits that, and I agree it's the honest wording.

Safe to merge from my read (CI green).

@frahlg
frahlg merged commit 7d2b8af into master Nov 11, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Verison button does not work on ha addon

2 participants