We’ve recently been working to upgrade the Firefox snap to core22 together with the gnome-42-2204 content snap. This mostly worked, but the published snap would not auto-connect to gnome-42-2204.
This seems to be due to the snap-declaration delivered by the store, which includes plug rules for the content interface:
$ snap known --remote snap-declaration series=16 snap-id=3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
...
plugs:
...
content:
allow-auto-connection:
-
plug-attributes:
content: $SLOT(content)
slot-attributes:
content: hunspell-dictionaries
slot-snap-id:
- bbCAYjcF3ZDMuOhmwCsm6j6KhyDVt2uW
-
plug-attributes:
content: $SLOT(content)
slot-attributes:
content: gnome-3-38-2004
slot-snap-id:
- rw36mkAjdIKl13dzfwyxP87cejpyIcct
-
plug-attributes:
content: $SLOT(content)
slot-snap-id:
- jZLfBRzf1cYlYysIjD2bwSzNtngY0qit
...
As there is a content interface rule defined on the plug side, the slot side rules are ignored for any connection candidate.
The plug rule allows connection to certain slots provided by hunspell-dictionaries-1-7-2004
, gnome-3-38-2004
, and gtk-common-themes
. There’s no rule for gnome-42-2204
though, so that connection fails even though the slot-side declaration would be happy to allow it.
My understanding is that the plug declaration was added because hunspell-dictionaries-1-7-2004
had no slot-side delcaration to allow connection, and it wasn’t clear whether one was desirable. But of course, this meant every other content interface needed to be enumerated in the plug declaration.
While adding gnome-42-2204
to the plug declaration would fix the immediate problem, it just means we’ll be back here again in a few years. I think a better option would be to remove the plug declaration for the content interface entirely.
While a hunspell-dictionaries
content interface plug was added to the nightly branch of the snap:
… we never added it to stable branch, instead only relying on the host-hunspell
plug to mount host system spelling dictionaries:
So the only part of the plug declaration we’re currently using are the gnome-3-38-2004
and gtk-common-themes
cases, which will both auto-connect based on their respective slot declarations.