-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Three D-Bus services #538
Three D-Bus services #538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a more generic name such as org.gnome.Hamster.Windows
I have to say, I was convinced this "windows service" was something used when installing Hamster on Windows rather than Linux. I didn't expect it to be something related to displaying app windows. 😅
For now, it is org.gnome.Hamster.GtkApp
Not org.gnome.Hamster.GtkApplication to make it clear it is a custom name.
In general, apps would just use a name like org.gnome.Hamster
. I've seen the equivalent of org.gnome.Hamster.Application
in other apps.
as the actions can only be accessed through a org.gtk.Actions interface anyway ?
I don't think there's any relationship between the name of your service and the interfaces it implements?
data/hamster.metainfo.xml
Outdated
@@ -27,7 +27,7 @@ | |||
</ul> | |||
</description> | |||
|
|||
<launchable type="desktop-id">hamster.desktop</launchable> | |||
<launchable type="desktop-id">org.gnome.Hamster.GtkApp.desktop</launchable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of flatpaking Hamster, and renaming the desktop file (and other resources as required by Flatpak) is something I was going to do.
So a big +1 for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew you were on to something good !
source= "org.gnome.hamster.service.in", | ||
target= "org.gnome.hamster.service", | ||
source= "org.gnome.Hamster.service.in", | ||
target= "org.gnome.Hamster.service", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind, I'd like to be sure I understand the difference between the org.gnome.Hamster
and org.gnome.Hamster.GtkApp
(currently called org.gnome.Hamster.Windows
) services.
Because what they do might have an impact on the naming to follow if we want Hamster to work properly inside Flatpak. (which I'd very much want)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.gnome.Hamster
is the database server:
hamster/src/hamster-service.py
Line 46 in 72a8e31
bus_name = dbus.service.BusName("org.gnome.Hamster", bus=self.bus) |
org.gnome.Hamster.WindowServer
is the legacy application windows server:
hamster/src/hamster-windows-service.py
Line 24 in 72a8e31
bus_name = dbus.service.BusName("org.gnome.Hamster.WindowServer", bus=self.bus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be aware that this "little" change with "hamster" becoming "Hamster" can cause quite some headaches for users already having those files.
If users start complaining about services not starting any more for strange reasons, they need to perform a "sudo rm /usr/share/dbus-1/services/org.gnome.hamster.*" to remove the old files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the warning,
but beware that postings on already merged issues are hard to remember.
So dbus launch is not case sensitive ?
Anyway there have been several other issues with old install remnants.
Warning set on the release page, in the wiki Troubleshooting section,
and updated README (ab5e9ea).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So dbus launch is not case sensitive ?
It is.
It's just that if people installed Hamster manually (i.e not with a package) then the old service files will be kept on the system, in parallel to the old ones, when those users updated their Hamster installation by simply running waf install
from a source tree.
Given that you also renamed the desktop files, the old desktop files would also linger on the system in the same way.
That has the potential to cause lots of confusion.
Personally, I'm of the opinion that people who compile/install their software manually from sources, without going through the safer packaging routes, are expected to be capable of dealing with this kind of problems, and the notice you added to the wiki/readme seems perfectly sufficient to me.
Side note:
because to comply with freedesktop specifications some files are camel-cased now.
The spec mandates a few things like the dotted-notation, the absence of hyphens (-
) and that each component starts with a letter. It does not mandate capitalizing the first letter of the last component. This is merely the emerging convention, but lots of apps use lower-case and that doesn't cause any problem and never should. I assume you did that on my suggestion, so I apologize for not having made that sufficiently clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... the notice you added to the wiki/readme seems perfectly sufficient to me.
Thanks for the discussion, it's reassuring.
I assume you did that on my suggestion
Partly, but your suggestions were perfectly inline with both
the freedesktop recommendations and the flatpak conventions.
Let's get to the bottom of it in #547.
If we can, it would be much better to make all file changes in one go.
Indeed, that is the gnome recommendation. Maybe we should transition from
That would be good as well. But application is a
So that would encompass the command line interface as well.
And from the D-Bus API Design Guidelines
|
On second thoughts, could we have different services accessing the same database ? Seems risky. |
Don't: https://sqlite.org/faq.html#q5 So, what I'm understanding is that Hamster has an app (which is also a DBus service) and a database server. (which is a second DBus service) Flatpak is quite strict in enforcing some things which used to only be conventions:
(Flatpak allows escape hatches for a lot of the above, but it makes life much more annoying) For the case we're looking at right now, that means all the DBus services must have a common prefix and that prefix should be the Flatpak app id. With all that in mind, my recommendation would be to have:
The transition for the DB server would be a bit of a pain though. 🙁 Another possibility (and do keep in mind I don't know much about the project or its codebase, which means I have no idea how feasible/desirable this is, I'm just a random person on the Internet 😜) would be to merge everything into a single This is similar to how GNOME Calendar works for example:
tl;dr: the most important thing is that all DBus names share a common prefix, and that prefix must be the Flatpak app id; things work much better when the Flatpak app id is also the GtkApplication appid, the desktop file name, the icon names, … Whatever you do, please please please do not end the app id / DBus name with |
Thanks for the discussion. The second layout (same id, different paths) is interesting, The plan is to release 3.0.beta this week-end and 3.0.rc1 the next one. The first layout would make sense for a new application, One possibility: consider the database server as the first component
Sorry, that might break, too close to release.
Sure. |
@bochecha OK, on second thoughts, that's doable, |
This PR is a different proposition for #533, without the shortcomings of #536.
The old
WindowServer
is kept, except internally it just launcheshamster <window name>
.It seems to work well.
The
Gtk.Application
must then have a different name.For now, it is
org.gnome.Hamster.GtkApp
Not
org.gnome.Hamster.GtkApplication
to make it clear it is a custom name.Not a more generic name such as
org.gnome.Hamster.Windows
as the actionscan only be accessed through a
org.gtk.Actions
interface anyway ?