Auto-connection request for network-manager for mccompanion

Auto-connection request for network-manager for mccompanion


name: mccompanion
description: MCCompanion is a feature-rich Minecraft companion application.
  Ping and monitor your servers, browse the wiki, manage skins, and more.
snapcraft: https://github.com/MCCORG/MCCompanion/blob/linux-prework/snap/snapcraft.yaml
upstream: https://github.com/MCCORG/MCCompanion/tree/linux-prework
upstream-relation: member & collaborator
plugs:
  network-manager:
    interface: [optional] one of https://snapcraft.io/docs/reference/interfaces/
    attributes: [optional] interface attributes if any
    request-type: auto-connection
    reasoning: The application relies on the official Flutter `connectivity_plus` plugin to verify real-time network connectivity before initiating background Minecraft server pings and local proxy routines.

On Linux desktop environments, `connectivity_plus` interfaces directly with NetworkManager via system D-Bus (`org.freedesktop.NetworkManager`) using `org.freedesktop.DBus.ObjectManager.GetManagedObjects`.

When strictly confined without an active `network-manager` connection, AppArmor intercepts these method calls with `AccessDenied`, preventing the app's startup connectivity checks from running properly and throwing unhandled D-Bus exceptions out-of-the-box.

We use this interface strictly for read-only connectivity monitoring to handle online/offline transitions gracefully.

This request has been added to the queue for review by the @reviewers team.

linux-prework has been merged to the main branch.

Hello @mccorg,

If the access needed is read-only connectivity monitoring, have you tried the network-manager-observe interface? The observe interface is preferred as it is a narrower scope, and would be an easy approval for auto-connection. If you have tried it and run into issues, please describe them here. Thank you!

Sorry observe doesn’t work:

Unhandled Exception: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=“:1.128” (uid=1000 pid=12953 comm=“/snap/mccompanion/x1/bin/MCCompanion” label=“snap.mccompanion.mccompanion (enforce)”) interface=“org.freedesktop.DBus.ObjectManager” member=“GetManagedObjects” error name=“(unset)” requested_reply=“0” destination=“org.freedesktop.NetworkManager” (uid=0 pid=1242 comm=“/usr/sbin/NetworkManager --no-daemon” label=“unconfined”) #0 DBusClient._callMethod (package:dbus/src/dbus_client.dart:1164)

#1 DBusClient.callMethod (package:dbus/src/dbus_client.dart:625)

#2 DBusRemoteObjectManager.getManagedObjects (package:dbus/src/dbus_remote_object_manager.dart:85)

#3 NetworkManagerClient.connect (package:nm/src/network_manager_client.dart:2351)

#4 ConnectivityPlusLinuxPlugin.checkConnectivity (package:connectivity_plus/src/connectivity_plus_linux.dart:25)

#5 ConnectivityChecker.check (package:MCCompanion/services/connectivity_checker.dart:13)

#6 _SplashScreenState._startSequence. (package:MCCompanion/screens/splash_screen.dart:55)

#7 Future.wait. (dart:async/future.dart:546)

#8 _SplashScreenState._startSequence (package:MCCompanion/screens/splash_screen.dart:50)