-
-
Notifications
You must be signed in to change notification settings - Fork 139
🐛 zb: Make PropertyStream yield changes if service starts later
#1389
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
base: main
Are you sure you want to change the base?
Conversation
Send events is settings daemon is started after the start of this subscription, or if it is restarted. To get updates when the daemon wasn't running at the start of the stream, z-galaxy/zbus#1389 is also needed. Loss of the name owner should probably also disable any brightness controls, but if that's done by a change of the brightness values and not by a seperate property, we probably can't rely on the ordering of events from different streams...
|
Seems to be working with that updating. (It would be nice if |
Nice!
Right. Could you please add a FIXEM comment pointing to the relevant issue? |
|
Added a comment. rust-lang/rust#29641 has been open since 2015, but apparently rust-lang/rust#87121 supersedes that, so maybe it will actually be stable this decade. |
|
@ids1024 the CI is failing. I think something goes wrong with the error conversion. Could you please have a look? |
|
With the error conversion commit, the But then there's the Because we already converted FDO error variants, and the Presumably changing that would require either a manual implementation of |
Hmm.. this shouldn't be happening. This is what I was hoping to avoid with this part of my suggestion:
|
|
@ids1024 do you intend to continue this work? |
I guess not. 😢 |
faaf8b8 to
e56d01d
Compare
CodSpeed Performance ReportMerging #1389 will not alter performanceComparing Summary
|
|
Well, if changing the definition of I guess the only not painfully verbose way to do that would be to add some kind of special case in the |
b1a18fe to
55ea2cd
Compare
|
It doesn't seem too hard to add a special case in the macro, using an internal boolean attribute parameter. |
44bc041 to
56d8687
Compare
|
@ids1024 Thanks so much for picking this up again! Although I pinged you (was just doing a quick old PR triage), I can't seem to remember exact details here so I'll have to re-read the discussion when I'm not tired (hopefully tomorrow morning). :) |
When converting a `Error` to a `fdo::Error`, map `Error::FDO` specially, instead of ending up with an `fdo::Error::ZBus(zbus::Error::FDO(fdo::Error::...))` This is implemented as a special case in the `DBusError` macro, using an attribute specific to this usage.
This seems like the simplest way to address z-galaxy#1111. Before this, a `PropertyStream` created when a service wasn't running would never yield a value, even if the service started later and send property change signals. But if a service stopped, and then was restarted, property changes would be received. It seems `PropertiesCache::init()` was returning an error, from trying to call `GetAll` with a destination that doesn't exist. Instead, let `init()` complete successfully (without populating the cache), so it returns a `PropertiesChangedStream` which is then monitored for changes. It may also be good if it yielded values when a service takes ownership of the name, but that's a separate issue since it also applies to service restarts. And an application can handle `OwnerChanged` itself relatively easily.
56d8687 to
b6d49c3
Compare
|
Added a comment on the special case in |
|
Sorry for the delay in reviewing. I've been drowning in work-work lately. 😭
Thank you!
Thanks for adding that but only the last commit is a bug fix so 🐛 doesn't seem appropriate for the other 2. Better candidates: 🥅 🚸. Otherwise we're ready to merge. |
Spoke too soon. I just realised we're missing a test case here. Would it be possible for you to add one? |
This seems like the simplest way to address #1111.
Before this, a
PropertyStreamcreated when a service wasn't running would never yield a value, even if the service started later and send property change signals.But if a service stopped, and then was restarted, property changes would be received.
It seems
PropertiesCache::init()was returning an error, from trying to callGetAllwith a destination that doesn't exist.Instead, let
init()complete successfully (without populating the cache), so it returns aPropertiesChangedStreamwhich is then monitored for changes.It may also be good if it yielded values when a service takes ownership of the name, but that's a separate issue since it also applies to service restarts. And an application can handle
OwnerChangeditself relatively easily.