vmiklos / plees-tracker

Plees Tracker is a simple sleep tracker for your Android phone.
https://vmiklos.hu/plees-tracker/
MIT License
149 stars 38 forks source link

Inconsistent display of star ratings #455

Closed foss- closed 2 months ago

foss- commented 2 months ago

For a night where a star rating has been set, that star rating is not reflected in the Past Sleeps overview page.

This isn't always reproducible and there are a few variants of the inconsistent behavior:

That makes me wonder, if the overview view is not correctly updated. Oddly, when testing a bit more I found that frantically scrolling up and down does seem to update the view and correct number of stars then shows. So indeed something is not properly refreshing and the scrolling seems to force a refresh?

PS: thanks for offering the feature to couple DND with sleep tracking. I always manually had to enable DND and I am very happy this is no longer needed. Removes friction shortly before going to sleep and trying to wind down.

vmiklos commented 2 months ago

Yes, this happens all the time if I do these steps:

1) Start the app 2) Go to the latest sleep activity 3) Set a rating there 4) Go back to the main activity -> rating is not updated.

I guess the trouble will be somewhere around calculateDiff() in SleepsAdapter.kt, but needs a bit of investigation.

vmiklos commented 2 months ago

The above fixes the problem for me, feedback is appreciated. If you don't build from source, I plan to cut the next release early next month.