Trying to refresh a snap incorrectly says 'snap "chromium_hwedge" has no updates available'

I’m using parallel installs and tried to refresh a snap from a branch.

% snap info chromium_hwedge
name:      chromium_hwedge
summary:   Chromium web browser, open-source version of Chrome
publisher: Canonical✓
store-url: https://snapcraft.io/chromium
contact:   https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
license:   unset
description: |
  An open-source browser project that aims to build a safer, faster, and more
  stable way for all Internet users to experience the web.
commands:
  - chromium_hwedge.chromedriver
  - chromium_hwedge
snap-id:      XKEcBqPM06H1Z7zGOdG5fbICuf8NWK5R
tracking:     latest/edge/hwacc
refresh-date: 22 days ago, at 07:35 -03
channels:
  latest/stable:    110.0.5481.77      2023-02-13 (2319) 156MB -
  latest/candidate: 110.0.5481.77      2023-02-09 (2319) 156MB -
  latest/beta:      111.0.5563.19      2023-02-09 (2317) 156MB -
  latest/edge:      111.0.5563.19      2023-02-09 (2317) 156MB -
installed:          110.0.5464.2-hwacc            (2292) 174MB -

% sudo snap refresh chromium_hwedge
error: cannot refresh "chromium_hwedge": refreshing disabled snap "chromium_hwedge" not supported

I’m not sure what snapd means with “disabled snap”. In Chromium’s dashboard the edge/hwacc branch was active and listed revision 2330.

So I kept trying, but only removing it and reinstalling it solved the problem:

% sudo snap refresh --channel edge/hwacc chromium_hwedge
snap "chromium_hwedge" has no updates available

% sudo snap remove chromium_hwedge
chromium_hwedge removed

% sudo snap install --channel edge/hwacc chromium_hwedge
chromium_hwedge (edge/hwacc) 111.0.5563.19-hwacc from Canonical✓ installed

% snap list chromium_hwedge
Name             Version              Rev   Tracking       Publisher   Notes
chromium_hwedge  111.0.5563.19-hwacc  2330  latest/edge/…  canonical✓  -

Is snapd handling this incorrectly?

Refresh does not work for snap in disabled state. Snap can be disabled with snap disable <snap_name>, but then it is expected to be indicated by snap info which does not seem to be the case for you, which is unexpected.

Can you reproduce the issue?

Example:

$ snap info hello
name:      hello
summary:   GNU Hello, the "hello world" snap
publisher: Canonical✓
store-url: https://snapcraft.io/hello
contact:   snaps@canonical.com
license:   unset
description: |
  GNU hello prints a friendly greeting. This is part of the snapcraft tour at https://snapcraft.io/
commands:
  - hello
  - hello.universe
snap-id:  mVyGrEwiqSi5PugCwyH7WgpoQLemtTd6
tracking: latest/edge
channels:
  latest/stable:    2.10   2022-01-14 (42) 106kB -
  latest/candidate: 2.10   2022-01-14 (42) 106kB -
  latest/beta:      2.10.1 2017-05-17 (29)  65kB -
  latest/edge:      2.12   2022-03-15 (52) 131kB -
installed:          2.12              (52) 131kB disabled

Now trying to refresh the disabled snap:

snap refresh hello --channel=latest/stable
error: cannot refresh "hello": refreshing disabled snap "hello" not supported

I certainly had not disabled the snap, I didn’t even know that command (:.

I tried to reproduce the issue by reverting to the 2292 revision.

% sudo snap refresh --revision=2292 chromium_hwedge
chromium_hwedge 110.0.5464.2-hwacc from Canonical✓ refreshed

% sudo snap refresh chromium_hwedge
chromium_hwedge (edge/hwacc) 111.0.5563.19-hwacc from Canonical✓ refreshed

% snap list chromium_hwedge
Name             Version              Rev   Tracking       Publisher   Notes
chromium_hwedge  111.0.5563.19-hwacc  2330  latest/edge/…  canonical✓  -

So it worked this time. ¯\_ (ツ)_/¯

The only difference I can think of between the original report and this second attempt that in the former I had 2292 for a long time, and the edge/hwacc branch might meanwhile have expired and then resurrected when I attempted the refresh.