No instructions for how to distribute multiple versions of an app
One of the great things about Flatpak is that you can distribute development versions of an app, as nightlies or something similar. The problem is that, if you give different versions of the app the same dbus name, they end up conflicting with each other [1].
It would be great to include guidelines for how to produce different versions. These would basically say:
- Rename the app in the .desktop file, such as adding "(Nightly)"
- Rename the dbus name, such as from "org.domain.app-name" to "org.domain.app-name-nightly"
[1] For details on how Software plans to deal with this issue, see https://bugzilla.gnome.org/show_bug.cgi?id=768729
I'm waiting on confirmation that the advice above is correct before I fix this.
The app ID will need to be changed in addition to the dbus name. I'm assuming that any changes made could be done as a part of the cleanup step or could be kept in tree.
Yeah, the above is correct if the goal is to have the two installed side-by-side in the UI. Additionally it is useful to add a "nightly" tag to the app, which will be added to the appdata so that gnome-software can show it in the app details.
This can be done with something like this in the json:
"desktop-file-name-prefix": "(Nightly) ",
"tags": ["nightly"],
It may also be nice to have a custom icon for the nightly to make things even clearer when launching the app in the desktop.
Some discussion on #flatpak about this today. Things get fairly messed up when launching apps if you have more than one installed with the same bus name. Generating nightlies so that they have different dbus names from the stable versions isn't all that straightforward though. (Although renaming the .desktop file to match a different bus name can be easily done as a part of the cleanup phase.)
For GApplication there's G_APPLICATION_CAN_OVERRIDE_APP_ID[0], which allows overriding the application ID (and thus the bus name) from the command line. Applications have to opt-in though, so not something that can be used unconditional during cleanup.
[0] https://developer.gnome.org/gio/stable/GApplication.html#GApplicationFlags
And notice that some get it wrong in places - e.g. the firefox nightly generally uses the nightly icon in shell chrome, but when it inhibits reboot, the icon I get for the inhibitor is the regular firefox one - the app id must be hardcoded somewhere deep inside firefox.