forrestguice / SuntimesWidget

Android app (and widget collection) that displays sunlight and moonlight times.
GNU General Public License v3.0
348 stars 61 forks source link

Sunset/Sunrise widget does not updates automatically #806

Closed DarthMazut closed 3 months ago

DarthMazut commented 5 months ago

Describe the bug Sunset/Sunrise widget does not update automatically. I need to click it in order to display up-to-date values (I've set to update widget on click).

To Reproduce Steps to reproduce the behavior:

  1. Create widget with Sunset/Sunrise
  2. Go to sleep...
  3. Look at the widget in the morning: it displays yesterday's values

Expected behavior The widget should display proper values at real time. Like no one expects that a clock requires click on its widget to display correct time...

Screenshots

Version Info:

My question regarding this is whether this affects sunset/sunrise notifications time?

forrestguice commented 5 months ago

Thanks for the report.

I think this is caused by aggressive battery optimization by your specific device. Unfortunately Xiaomi devices have a reputation for this. It might be possible to fix it by following these recommendations, or one of the solutions at https://dontkillmyapp.com/.

My question regarding this is whether this affects sunset/sunrise notifications time?

Very likely. If widgets fail to update, I'm also betting that alarms/notifications fail too (since both rely on the same underlying AlarmManager).

HolyNameSoftware commented 3 months ago

Maybe it is a combination of things but mostly having to do with Android OS after android 4 or 5 widgets quit being "live". Was probably also a semi security conscern. BTW why isn't Suntimes on Google play store?

philibeur commented 3 months ago

Hello, I have the same issue on the Samsung Galaxy a34 5g and not in my old a7(2018), probably the economy battery mode. But it's only the suntime widget not the moon phase widget who has this issue.

ericjs commented 3 months ago

I have the same problem with the clock widget, on a Pixel 7 Pro, using GrapheneOS. It was updating fine until just recently. Allow background battery usage is enabled.

forrestguice commented 3 months ago

@ericjs When you say recent, is this something you would attribute to the v0.16.0 update?

The targetSdk was bumped from 25 to 28 recently, while api26 introduces additional background restrictions. I am thinking that the update broadcast itself might actually be blocked (in which case I'm very sorry, I should have caught it sooner).

ericjs commented 3 months ago

@forrestguice I wish I could tell you, but I haven't paid close enough attention to updates and don't know if I realized it wasn't updating right away. I can't rule out it having been a GrapheneOS update. Would anything in the logs suggest whether it was or wasn't the update broadcast being blocked?

ericjs commented 3 months ago

(When I said the logs, I was thinking there were some logs I'd seen in Suntimes, but I think I the logs I was remembering were in a different app. I spent some time thinking my clock widget was from another Clock app before I figured out it was from Suntimes. So my question about logs probably wasn't very helpful, sorry.)

ericjs commented 3 months ago

I suppose I should at least clarify that I am running 0.16.0. And that by "recent" I mean I noticed in the last couple days. I'm just not sure when I got the Suntimes update.

forrestguice commented 3 months ago

@ericjs Thanks for the reply. I think I've found the problem, so I'm optimistic this will be fixed in v0.16.1.

ericjs commented 3 months ago

@forrestguice Thank you!

philibeur commented 2 months ago

Thank you for the job!