Skip to content
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

Avoid calling Refresh on org.freedesktop.UPower.Device #568

Open
favonia opened this issue Jul 17, 2023 · 5 comments
Open

Avoid calling Refresh on org.freedesktop.UPower.Device #568

favonia opened this issue Jul 17, 2023 · 5 comments

Comments

@favonia
Copy link

favonia commented Jul 17, 2023

Describe the bug

UPower is deprecating or removing the Refresh method. We should stop using it.

As far as I understand, calling Refresh was introduced in #330. However, since UPower 0.99.14, Refresh has been deprecated, and since UPower 0.99.18, Refresh has been permitted only in the debug mode. It seems trivial to delete all the code that triggers Refresh, but I would like to create an issue first before making a pull request.

To Reproduce

  1. Run Taffybar 4.0.0 with UPower 1.90.2
  2. Observe messages as follows:
    [ERROR] System.Taffybar.Information.Battery - Failed to refresh battery: MethodError {methodErrorName = ErrorName "org.freedesktop.DBus.Error.UnknownMethod", methodErrorSerial = Serial 15, methodErrorSender = Just (BusName ":1.20"), methodErrorDestination = Just (BusName ":1.52"), methodErrorBody = [Variant "Method Refresh is not implemented on interface org.freedesktop.UPower.Device"]}
    

Expected behavior

I expect no errors or warnings.

Version information

  • Taffybar version (or git sha if building from source): 4.0.0
  • Installation method (nix/stack/cabal/arch packages): cabal install
  • Gtk version: 3.24.38
@colonelpanic8
Copy link
Member

It's already separated out into its own hook that isn't enabled by default:

refreshBatteriesOnPropChange

https://github.com/taffybar/taffybar/blob/b57006885d35cee63244b1559813ca4b5990e04c/src/System/Taffybar/Hooks.hs#L63

with this convenience hook, which is not set by default.

This seems like a super random thing to be worried about. What drew your attention to this?

@favonia
Copy link
Author

favonia commented Jul 17, 2023

@IvanMalison Thank you. I didn't realize I was using withBatteryRefresh in my current configuration. Removing it seems to be fine so far.

This got my attention because the error appears every time the battery information is changed, not just one time. My system logging had been full of this refresh error generated by Taffybar.

I still think we should remove the code that will not work properly with newer UPower (as the UPower API has been changed for more than one year).

Should I close this issue now? I'm no longer bothered by the code (that I think should still be removed or changed).

@colonelpanic8
Copy link
Member

You can leave it the issue for now.

I'd welcome a PR, especially if you can verify that there are no longer issue on macbook hardware without this fix.

@colonelpanic8
Copy link
Member

I don't have a macbook myself, anymore, so I cant verify.

@favonia
Copy link
Author

favonia commented Jul 17, 2023

Unfortunately I'm not using a MacBook, either. 😟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants