How to disable refresh-app-awareness for my app?

I’ve built a Snapcraft app that launches initially with a GUI user interface and then, when the user registers the app and closes the interface, it runs in the background while displaying a tray icon. On reboot, it launches into the background with the tray icon displaying through the same command, no GUI necessary (apart from the tray icon, which can launch a GUI window when clicked). The user is not supposed to manually turn off the app, and they know and accept this when they install it. This is what they want.

The YAML command that launches the app is not currently defined in YAML as a daemon.

Recently, when a user tries to manually refresh to the latest version on Edge, they receive an error:

Cannot refresh: snap has running apps

It used to refresh with no difficulty. Now it won’t refresh at all. The user apparently has to manually turn off the app (which, as I said, they are not supposed to do) in order to refresh it.

I’m pretty sure this is a result of refresh-app-awareness.

I tried adding refresh-mode: restart to the app command in YAML, but when snapping it I received an error stating that refresh-mode was only for daemons:

The property does not match the required schema: 'daemon' is a dependency of 'refresh-mode'

I tried setting daemon: simple, but then the app command didn’t work at all.

I’d really rather not have to rewrite my entire app just so users can get updates like they used to!

Is there any way to turn off this new feature in my CORE-18 YAML, since the old way worked great for my app? If not, what do you recommend for my unique situation, where the user should not turn off the app and it is not defined in YAML as a daemon (nor do I seem to know how to make it work as a defined daemon)?

Thanks in advance!

1 Like

Not sure if you can disable refresh-app-awareness. Keep in mind, though, that the app will be update at some point: updating can be delayed for as much as 14 days; after that, snap daemon will proceed with the update, as usual.

@ivo.cavalcante are you saying that when a user on stable manually tries to refresh the app to edge and it tells them no, nevertheless, after they restart their device (or something like that) it will refresh to edge anyway because they asked it to?

Or are you saying that if the app is on stable, and a new version is available on stable, then, though it is impossible for the user to manually refresh it to edge (without shutting down the app), it will eventually refresh to the latest stable version automatically, regardless of manual user attempts?

I was talking specifically about your second phrase.

Or are you saying that if the app is on stable, and a new version is available on stable, then, though it is impossible for the user to manually refresh it to edge (without shutting down the app), it will eventually refresh to the latest stable version automatically, regardless of manual user attempts?

It is exactly this; if, after 14 days, snapd can’t cleanly update the app, then it will do it nevertheless. That’s what is described in the thread you linked.

@ivo.cavalcante you do make a good point. It would still be nice to have the option to turn it off in my YAML.