I cannot see files in SNAP_COMMON if content interface plug is that folder

Hey,

We have a courious behaviour in certain snap. We use wifi-ap snap exposed control interface from wifi-connect snap. That is a content share interface which exposes a socket. From consumer part, it is mounted in $SNAP_COMMON folder. All works fine, except that wifi-connect snap does other internal operations which result in other files written in that same folder. If I access as a regular/root user to /var/snap/wifi-connect/common I cannot see those created files. However, if I open a shell (snap run --shell wifi-connect), I can see them there. That makes sense somehow to me, as that folder is where control interface is mounted, and any other files will be available in that mount namespace but, is this intentional or can be considered as a bug?.

I’m thinking in somebody using snaps for the first time and seeing some files are not there in the SNAP_COMMON path where he thought there were going to be.

When we content share to $SNAP_COMMON/subdir/ the root user always sees the same files as you see with sudo snap run --shell…

When we content share to just $SNAP_COMMON/ , as Roberto explained, the files are different.

Is this by design or have we found a bug?