Snapd not pulling in content snap with suitable slot

Something curious just happened.

I’ve released kde-frameworks-5 r26 to the stable channel (previously only was in candidate). It adds a new slot

    kde-frameworks-5-46-qt-5-10-ubuntu-1604:
        content: kde-frameworks-5-46-qt-5-10-ubuntu-1604
        interface: content
        read:
        - "."

which is used by the application snap bovo r5 in the candidate channel.

    kde-frameworks-5-plug:
        content: kde-frameworks-5-46-qt-5-10-ubuntu-1604
        interface: content
        default-provider: kde-frameworks-5
        target: kf5

Now, since bovo r5 wants to connect to the new content slot from kde-frameworks-5 r26 my expectation after releasing was that snap install --candidate bovo would force a refresh of the kde-frameworks-5 snap so it would be able to provide the slot, except snapd didn’t do that.
That leaves me with a broken bovo now. The system still has the old kde-frameworks-5 installed, which doesn’t provide the required slot for the ABI set bovo was built against.
As one would expect explicitly calling snap refresh will pull in the new kde-frameworks-5 and connect bovo.

Bug?

Surely snapd should make sure it has the newest version of a content snap upon installing a consumer of the content snap, not only that the content snap is installed.

2 Likes

That’s an interesting case indeed. I don’t think we can do just that without also understanding a more general rule. What if one installs a snap and the default provider is already on the system? Should a refresh be considered? What about other interfaces: why would we special case the content interface and not every other interface that a snap has connected, or will connect?

Mainly a brainstorm for now…

@pedronis @mvo @pstolowski What do you think?