Skip to content

fix(single-instance): unconventional dbus names (fix #3184)#3194

Merged
FabianLars merged 18 commits intotauri-apps:v2from
mrquantumoff:single-instance
Feb 3, 2026
Merged

fix(single-instance): unconventional dbus names (fix #3184)#3194
FabianLars merged 18 commits intotauri-apps:v2from
mrquantumoff:single-instance

Conversation

@mrquantumoff
Copy link
Contributor

@mrquantumoff mrquantumoff commented Jan 4, 2026

Flathub no longer allows the "org.app_id.SingleInstance" dbus id that was allowed as an exception previously. Thus, I implemented an optional feature that would allow developers to use a more conventional dbus name that would pass the Flathub inspections without causing extra issues.

The Flathub discussion
flathub-infra/flatpak-builder-lint#819 (comment)

@mrquantumoff mrquantumoff requested a review from a team as a code owner January 4, 2026 09:53
@FabianLars
Copy link
Member

I really appreciate the PR but please check out #3184, we've had a slightly different approach in mind.

@mrquantumoff
Copy link
Contributor Author

Thank you for informing me about your approach to this issue. I suppose your way of solving the problem is better than just adding an another feature to the crate. In this case, I'll wait for the official implementation and use my own implementation for the time being.

@FabianLars
Copy link
Member

nono your implementation wasn't that far off. I just wouldn't put it behind a feature flag and instead force the new ids on all users 🤷

@FabianLars
Copy link
Member

one thing that's a bit of an annoyance with zbus is the interface name, i'd like to have that match the dbus name but it needs to be defined at build time if we don't want to code everything ourselves. The spec says "should ..." when it comes to that though so ig it doesn't matter that much

@mrquantumoff mrquantumoff reopened this Jan 4, 2026
@mrquantumoff mrquantumoff marked this pull request as draft January 4, 2026 15:43
@mrquantumoff
Copy link
Contributor Author

In that case, I'll rework some part of it, to match the intended vision a bit more

@mrquantumoff mrquantumoff changed the title Add a "conventional dbus" feature in order to be able to publish to flathub easily Fix the unconventional dbus names in the single instancew plugin Jan 4, 2026
@mrquantumoff
Copy link
Contributor Author

mrquantumoff commented Jan 4, 2026

I added an option to set the DBus ID at compile time. Made the conventional dbus naming the standard one. I chose to check for DBUS_ID instead of FLATPAK_ID in order to keep better compatibility with people who want to package snaps.

@mrquantumoff mrquantumoff marked this pull request as ready for review January 4, 2026 17:01
@mrquantumoff mrquantumoff changed the title Fix the unconventional dbus names in the single instancew plugin Fix the unconventional dbus names in the single instance plugin Jan 4, 2026
@amrbashir
Copy link
Member

Please document that env var in lib.rs documentation and README.md

@FabianLars
Copy link
Member

As far as i understood it, FLATPAK_ID is set by flatpak at runtime. A compile time env var in my opinion makes little sense and if we want that we should rather have a setter in rust.

@amrbashir
Copy link
Member

Yup, that's actually better

chrox added a commit to readest/tauri-plugins-workspace that referenced this pull request Jan 16, 2026
chrox added a commit to readest/tauri-plugins-workspace that referenced this pull request Jan 16, 2026
@chrox
Copy link

chrox commented Jan 22, 2026

👍 I’ve confirmed that this approach works for releasing new updates on Flathub.

Here’s what needs to be done:

  1. When building the Tauri app, set an environment variable, for example: export DBUS_ID=com.bilingify.readest
    The DBUS_ID must exactly match the Flathub app ID defined in the Flatpak manifest YAML file.

  2. In the Flatpak manifest, you no longer need to define own-name or talk-name for the D-Bus names.

See https://github.com/flathub/com.bilingify.readest

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

Package Changes Through 75ea39f

There are 1 changes which include single-instance with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
single-instance 2.3.7 2.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@mrquantumoff mrquantumoff changed the title Fix the unconventional dbus names in the single instance plugin fix: unconventional dbus names in the single instance plugin (fix: #3184) Jan 26, 2026
@mrquantumoff mrquantumoff changed the title fix: unconventional dbus names in the single instance plugin (fix: #3184) fix: unconventional dbus names in the single instance plugin (fix #3184) Jan 26, 2026
@mrquantumoff
Copy link
Contributor Author

mrquantumoff commented Jan 26, 2026

Sorry for not signing my commits beforehand and for messing up some of the existing ones. I am not used to signing commits with git.

@mrquantumoff mrquantumoff marked this pull request as draft January 26, 2026 13:30
@mrquantumoff mrquantumoff marked this pull request as ready for review January 26, 2026 13:44
@FabianLars
Copy link
Member

looks like you meant to force-push? your old unsigned commits are still there. I'm very bad with git operations either so i can't really help. I personally would probably reset the branch and copy over the changes manually 😅

On the PR changes themselves. I think we should remove the env var reading. If devs want that they can use the setter with the env!() macro themselves.
For the setter we should not rely on LazyLock (or the once_cell crate if we were to get down the MSRV), but instead use the Builder pattern, with the init function being a shortcut for those not wanting to set the id. I think the opener plugin's code is a fairly good example https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/opener/src/lib.rs#L178-L244

@mrquantumoff mrquantumoff changed the title fix: unconventional dbus names in the single instance plugin (fix #3184) fix(single-instance): unconventional dbus names (fix #3184) Jan 30, 2026
@FabianLars
Copy link
Member

@amrbashir Sorry but i think i'll need your review here since my changes were a bit much x)

@FabianLars FabianLars requested a review from amrbashir February 3, 2026 12:56
@FabianLars FabianLars merged commit 98e2c11 into tauri-apps:v2 Feb 3, 2026
16 checks passed
@nekename
Copy link

nekename commented Feb 4, 2026

Thank you to all involved. This now brings my app to 99% feature parity when running on Flatpak :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants