Paperize icon indicating copy to clipboard operation
Paperize copied to clipboard

[Bug] Wallpaper Change Time not consistent

Open Wrakor opened this issue 1 year ago • 35 comments

Describe the bug Following up on this enhancement.

There's something weird going on, the wallpaper is changing more often than it should. I've set it to change at 9AM every day, but it ends up changing randomly during the day (usually just once or twice).

To Reproduce Steps to reproduce the behavior:

  1. Set time interval to 1 day, and set a specific hour.
  2. See how the wallpaper will change more than that set time.

Expected behavior The wallpaper should only change at the set time.

Screenshots Here are some examples where I've noticed the wallpaper change when it shouldn't, as you can see on the "Last change" time (I didn't manually cause an image change).

Sometimes even the next change time gets messed and I have to set the time again (even though it's supposedly already at 9AM):

Smartphone (please complete the following information):

  • Device: Pixel 9 Pro XL
  • OS: Android 15 App version: v2.3.0

Wrakor avatar Oct 19 '24 12:10 Wrakor

Just as a heads up, I am looking into this. I'm not really sure why this is happening and it's very irregularly reproducible for me, so it might take me a bit.

Anthonyy232 avatar Oct 20 '24 07:10 Anthonyy232

Just as a heads up, I am looking into this. I'm not really sure why this is happening and it's very irregularly reproducible for me, so it might take me a bit.

Sure, appreciate it 👍

Wrakor avatar Oct 20 '24 12:10 Wrakor

Okay so for the first two sets of pictures, I was not able to replicate it. However, I noticed that the last set time is slightly before the time of the screenshot (shown in the status bar). Maybe there is some confusion here, when you set the album, it first changes the wallpaper a first time, and then the next one would be whatever you set it to be.

So for example, the time is 12:00 AM, my interval is three hours, and I choose the starting time to be 6:00 AM. Then, when you enable the wallpaper changer/select an album, last set time is set to 12:00 AM, and the next set time is set to 6:00 AM. After it triggers at 6:00 AM, the next instance would be 9:00 AM.

For the second set of pictures, I have confirmed that there is a bug -- purely a visual one in the calculating logic. The next set time and the actual time the wallpaper changes did not line up with each other. I have fixed it and just testing it on my device for a couple days to make sure I don't notice any weird behavior.

Anthonyy232 avatar Oct 24 '24 18:10 Anthonyy232

For the second set of pictures, I have confirmed that there is a bug -- purely a visual one in the calculating logic. The next set time and the actual time the wallpaper changes did not line up with each other. I have fixed it and just testing it on my device for a couple days to make sure I don't notice any weird behavior.

It doesn't seem to be a visual bug.

Today, it showed that the next change would be at 12:02:

And it did in fact change:

While also updating the next time to 12:07. Note that the supposed time of change is 9:30.

Does the app need an internet connection for the wallpaper to refresh?

Wrakor avatar Nov 02 '24 01:11 Wrakor

Guess I'm wrong haha. I'll keep looking into that. I wonder if somehow exact alarms aren't being exact now -- might be an SDK 35 thing. Sorry for the lack of updates, been busy with school

edit* no, the app never connects to the internet

Anthonyy232 avatar Nov 02 '24 01:11 Anthonyy232

Np 🙂 I've tried changing the background usage permission of the app from Optimized to Unrestricted, will see if it helps.

Wrakor avatar Nov 02 '24 01:11 Wrakor

Sure, let me know! Are you also able to test if smaller intervals also encounter this problem, or just the 1 day interval? Also if the issue occurs if there is no starting time set.

Anthonyy232 avatar Nov 02 '24 23:11 Anthonyy232

Changing the background usage setting didn't prevent the issue, unfortunately.

I've turned on notifications to detect these changes better, and sure enough today I got one at 17:07, even though the next time should be only tomorrow.

Screenshot_20241102-170754

My guess would be that the defined time is being overriden by the current time when I'm setting the time I want, or something like that.

Sure, let me know! Are you also able to test if smaller intervals also encounter this problem, or just the 1 day interval? Also if the issue occurs if there is no starting time set.

I can try reseting the change time, and see if it persists.

Wrakor avatar Nov 02 '24 23:11 Wrakor

Well the thing is that the changing starting time should only affect the first scheduled wallpaper change -- and then subsequent ones are just based on current time. For example if my interval is 1 hour and my starting time is 9 AM. Then the first alarm is set for 9 AM, and then anything afterwards is simply current + interval, so 9 AM + 1 hr, 10 AM + 1 hr... at least in theory...

I'll keep testing :)

Anthonyy232 avatar Nov 03 '24 00:11 Anthonyy232

If it doesn't work, let me know, it would be awesome if you could test an update for me to see if that fixes things at all

Anthonyy232 avatar Nov 03 '24 18:11 Anthonyy232

Ok, I might have found what's causing the issue.

Today I got a notification informing me of the next change:

Screenshot_20241103-220732

And right after receiving that notification, the wallpaper changed:

Notice the device's clock, it's 22:07, and the notification was received 17 minutes ago, which matches the time you see on the image: 21:49.

This means the "warning" about the next wallpaper change is triggering a change itself.

(Btw, this happened even without having a custom change time)

If it doesn't work, let me know, it would be awesome if you could test an update for me to see if that fixes things at all

Yeah, sure, I could test it 👍

Wrakor avatar Nov 03 '24 22:11 Wrakor

Just to add that this issue doesn't happen with a 12 hour interval, even with a custom time.

Wrakor avatar Nov 05 '24 23:11 Wrakor

Interesting -- currently doing some app refactoring as I'm not really happy with performance but I'll examine why it occurs for 24 hrs. If you have free time, let me know about other intervals, both shorter and longer if possible 😀

Anthonyy232 avatar Nov 06 '24 00:11 Anthonyy232

I'm now testing 23 hours, will report tomorrow. Something that I noticed is that you can set the interval to either 1 day or 24 hours (1st slider or 2nd slider) - seems a bit redundant, maybe the interval hour slider should only go up to 23? 🤓

Wrakor avatar Nov 06 '24 22:11 Wrakor

The issue continues to happen, I've also tried with 16 hours.

The notification that warns about the next planned change keeps triggering a change, that's been recurrent in my testing.

And sometimes it also changes outside that, unexpectedly. I'm guessing the change triggered by the notifications messes up the timings internally.

Oh, well, hoping you can fix this.

Wrakor avatar Nov 08 '24 18:11 Wrakor

I'm in the process of refactoring a large chunk of the app and hopefully that will fix this as a side effect, if not, I'll keep at it :D

Anthonyy232 avatar Nov 11 '24 19:11 Anthonyy232

Hey, would you be willing to check out a test build to see if there are any bugs regarding this nature (or anything else)?

Anthonyy232 avatar Feb 26 '25 19:02 Anthonyy232

Hey, would you be willing to check out a test build to see if there are any bugs regarding this nature (or anything else)?

Hey, sure 👍

Wrakor avatar Feb 27 '25 23:02 Wrakor

Thanks! Let me know of any bugs. https://drive.google.com/file/d/1-8BJGw9rSx7iYzPuBL3-P98JjB0XZwJn/view?usp=sharing

Anthonyy232 avatar Mar 07 '25 20:03 Anthonyy232

It seems that it has the same (or similar issues).

I have set an interval of 15 hours for a change of wallpaper. When I turned off my Airplane Mode this morning, the wallpaper changed. And when I restarted the phone it changed again. It should've only changed later:

If you're using Workers, maybe its logic needs to be reviewed - like, is it needing an internet connection? What is exactly is triggering these ahead of schedule changes?

Wrakor avatar Mar 08 '25 11:03 Wrakor

It has to reapply on restart as restart destroys alarm managers so that's expected behavior. Not sure about airplane mode though.. that's odd.

Anthonyy232 avatar Mar 08 '25 17:03 Anthonyy232

I did turn off my morning alarm around the same time, so it might have something to do with that.

I've found a bug with the wallpaper, when it's set to Fill, it appears with some weird effects:

Image

Image

For reference this is the original wallpaper:

Image

Wrakor avatar Mar 08 '25 23:03 Wrakor

Another thing to report, which was the wallpaper change stopped working.

Here, you can see that the change time was 08:11 and this screenshot was taken at 09:00, without the wallpaper having changed. (Also, the language changed back to Portuguese, I had previously set it to English, and it is so in system app settings)

I then toggled off and on the wallpaper album at 12:47, which updated the next change time, but to 13:02 for some reason (15 minutes):

After a phone restart, it seems to have gone back to normal - both the app language and the wallpaper change timer.

Edit: it just happened again, re-toggling the wallpaper album sets the next change time to be 15 minutes after instead of 15 hours. Readjusting the Interval fixed it. Some unit conversion issue?

Wrakor avatar Mar 10 '25 19:03 Wrakor

I did turn off my morning alarm around the same time, so it might have something to do with that.

I've found a bug with the wallpaper, when it's set to Fill, it appears with some weird effects:

Image

Image

For reference this is the original wallpaper:

Image

Seems like the image is banding, probably set to a lesser rgb standard, I'll look into that

Anthonyy232 avatar Apr 01 '25 05:04 Anthonyy232

I then toggled off and on the wallpaper album at 12:47, which updated the next change time, but to 13:02 for some reason (15 minutes):

I can repro the interval bug and will fix it. Still not sure why it stops working though

Anthonyy232 avatar Apr 01 '25 05:04 Anthonyy232

Hey, got a new version, would you mind testing to see which if any of the previous issues still occur? Thanks.

https://drive.google.com/file/d/1-iae_D9rHpVkSg6zYEz77qiUnZm7f1qs/view?usp=sharing

Anthonyy232 avatar Apr 07 '25 06:04 Anthonyy232

Okay, the whole refresh thing seems to stem from (https://github.com/ItzNotABug/DocumentFileCompat/issues/19) so I'm just waiting for an update on that. If you got the chance, did you notice anything else?

Anthonyy232 avatar Apr 14 '25 20:04 Anthonyy232

Hey. Nothing to report, other than the main issue still happening.

I have a 14-hour interval defined. In this example, the next change was scheduled for 4:23 AM:

But the next day, I looked at it and it actually changed at 3:07 AM:

The it changed at 5:07 PM as expected, but it changed again around an hour later, at 6:23 PM (no settings were changed on my side):

Do you have any analytics/logs implemented on the app, that you could check on your side to try and pinpoint the issue? If not, then maybe that's something you can try to implement, some analytics when a wallpaper changes, with the current applied settings. Nothing much else that I can do on my side.

Wrakor avatar Apr 15 '25 19:04 Wrakor

I don't have analytics or logs enabled on the app that I could pull from other people. I'll keep looking. Can I ask if the first occurrence is before the first change or after (ex: you just set it for 14 hours, then it occurs at 12 hours, or it is 14+12 hours)?

Anthonyy232 avatar Apr 17 '25 03:04 Anthonyy232

For the first occurrence, the change happened around 1 hour earlier than 14 hours (3:07 instead of 4:23).

Wrakor avatar Apr 17 '25 11:04 Wrakor