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

Sunset/Sunrise widget does not updates automatically #806

Closed
DarthMazut opened this issue Jun 15, 2024 · 11 comments · Fixed by #821
Closed

Sunset/Sunrise widget does not updates automatically #806

DarthMazut opened this issue Jun 15, 2024 · 11 comments · Fixed by #821
Labels
Milestone

Comments

@DarthMazut
Copy link

DarthMazut commented Jun 15, 2024

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

  • No provided -

Version Info:

  • App Version: 0.15.15 (dea8fef)
  • Android Version: 12 SKQ1.211006.001
  • Device Model: Xiaomi 12T Pro, MIUI 13.0.24 (Stable)

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

@forrestguice
Copy link
Owner

forrestguice commented Jun 15, 2024

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

This comment was marked as off-topic.

@philibeur
Copy link

philibeur commented Aug 11, 2024

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
Copy link

ericjs commented Aug 13, 2024

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
Copy link
Owner

@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
Copy link

ericjs commented Aug 13, 2024

@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
Copy link

ericjs commented Aug 13, 2024

(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
Copy link

ericjs commented Aug 13, 2024

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
Copy link
Owner

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

forrestguice added a commit that referenced this issue Aug 14, 2024
assign widget `updateInterval` so that in addition to the normal update loop, the system sends a broadcast every ~6 hours, restoring exact widget update alarms (that may have been killed due to battery opt) (#806)
forrestguice added a commit that referenced this issue Aug 14, 2024
detect stale widgets (and perform an update) whenever the `ACTION_APPWIDGET_UPDATE` broadcast occurs (#806)
forrestguice added a commit that referenced this issue Aug 14, 2024
assign package name to widget update intents (so they are explicit) (#806)
Repository owner deleted a comment from HolyNameSoftware Aug 14, 2024
forrestguice added a commit that referenced this issue Aug 16, 2024
assigns `updateInterval` to trigger recovery of stale widgets (#806).

* 1 hour: clock, alarm, and sun position widgets
* 6 hours: sun and moon widgets
* 24 hours: date and solstice widgets
@forrestguice forrestguice added this to the v0.16.1 milestone Aug 16, 2024
@ericjs
Copy link

ericjs commented Aug 20, 2024

@forrestguice Thank you!

@philibeur
Copy link

Thank you for the job!

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

Successfully merging a pull request may close this issue.

5 participants