Skip to content

Respect the selected channel when updating firmware - #75

Merged
jfmlima merged 2 commits into
mainfrom
fix/update-button-ignores-channel
Jul 31, 2026
Merged

Respect the selected channel when updating firmware#75
jfmlima merged 2 commits into
mainfrom
fix/update-button-ignores-channel

Conversation

@jfmlima

@jfmlima jfmlima commented Jul 31, 2026

Copy link
Copy Markdown
Owner

The confirm button in the device firmware dialog was gated on a device-wide "has updates" flag while the release panel beside it was gated per channel. On a device with a stable release and no beta, selecting Beta hid the panel but left the button live, and pressing it asked the device to install firmware that does not exist.

Both now read the same per-channel lookup, and that lookup requires the channel to name an actual build. A channel the device advertises without a version installs nothing, so it no longer counts as an update anywhere: not for the release panel, the confirm button, the channel labels, or the header badges.

When the selected channel has nothing to install, the dialog says so, and it distinguishes a channel with no update from a device with no updates at all. It stays quiet until the status has loaded rather than claiming there is nothing while the request is still in flight.

Check for Update now refreshes the cached status, so a channel that has just gained a release stops reading as empty.

Updating via the manager is unaffected. That path resolves the release from the Shelly firmware index rather than from what the device reported, and does its own check for already being current.

Verifying

There is no test setup in packages/web, so this was driven by hand against a stubbed API, checking the confirm button, the release panel and the message for each case:

Device Channel Button Shown
stable release only Stable enabled release panel
stable release only Beta disabled no update on this channel
beta release only Stable disabled no update on this channel
beta release only Beta enabled release panel
beta advertised with no version Beta disabled no update on this channel
nothing on any channel Stable disabled no updates available
status still loading Stable disabled neither
any via manager enabled channel selector hidden

Starting an update from a channel that has a release still sends that channel.

Worth knowing

The gate is advisory rather than enforced. The bulk dialog, the raw RPC console on the same page, the CLI and the API itself can all still ask a device for a channel it has nothing on.

What a device does with a beta request when it has no beta is still unconfirmed. It either refuses or accepts and does nothing. The dialog no longer offers the choice either way, but the answer belongs next to the note in to_update_parameters.

jfmlima added 2 commits July 31, 2026 21:10
The confirm button was gated on the device-wide has_updates flag while
the release panel was gated per channel, so picking a channel with no
firmware left the button live and sent the device an update it had
nothing to install. Gate both on the same per-channel lookup, and show
a message where the release panel would be when the channel is empty.

The local source stays exempt: it resolves the release from the Shelly
firmware index rather than from what the device reported.
A channel the device advertises without naming a build installs nothing,
but the dialog read the raw entry as truthy, so it offered a release with
a blank version and left the confirm button live. Read every channel
through one helper that requires a version, and use it for the release
panel, the confirm button, the channel labels and the header badges so
they cannot drift apart again.

The empty-channel message now separates a channel with no update from a
device with no updates at all, and stays hidden until the status has
loaded rather than claiming there is nothing while the request is still
in flight.

Check for Update now refreshes the cached status it invalidates, so a
channel that gained a release stops reading as empty.

UpdateInfo now marks the device-reported fields optional, and the
filtered summary shape gets its own type, since it renames desc to
description and is not interchangeable.
@jfmlima jfmlima self-assigned this Jul 31, 2026
@jfmlima
jfmlima merged commit a978f8a into main Jul 31, 2026
4 checks passed
@jfmlima
jfmlima deleted the fix/update-button-ignores-channel branch July 31, 2026 20:40
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.

1 participant