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

Show zero instead of empty text when no sleeps are recorded #436

Closed goldbattle closed 3 weeks ago

goldbattle commented 4 months ago

Reproducer steps Just updated to 7.6.4. Enabled automatic backups and display of average sleep length. Return to the start screen and all my past recordings disappear.

Actual result My tracks are gone. I can still see there are some statistics that show that I have some sleeps..

Screenshot_20231227_154840_Plees Tracker.jpg Screenshot_20231227_154836_Plees Tracker.jpg

I exported and it seems they are still recorded possibly? Should I try to reimport this csv?

Screenshot_20231227_155143_Sheets.jpg

Expected behavior To not lose all my historical tracks. I have no backups, so everything is lost it seems?

vmiklos commented 4 months ago

Sorry to hear that seems to be a data loss!

I just tried enabling automatic backup with a clean user profile and can't trivially reproduce this problem. Does it happen to you all the time you perform these steps or it happened only once?

Also, does this only happen with your phone or does it also happen in the emulator?

Last, does this happen even after you restart the app?

The internal storage is just sqlite and the stats are always calculated from scratch, so if you see your sleeps in the stats, then probably they are in the DB. This would suggest the DB is all fine, but the main activity's live update somehow gets confused and shows no sleeps. Does this still happen after you kill the app + start it again? I.e. is this a problem when you already changed your settings but the already running app tries to adapt itself to the new setting?

Let's try to clarify the reproducer steps to reach a state when this happens in a from-scratch emulator run, then it would be possible to debug this. Thanks.

goldbattle commented 3 months ago

I was unable to pull out the database over adb, so not sure what I can do to provide. I was able to record new sleeps fine, it seems the interface is just empty when I have not done any recent sleeps. Seems that the history on the main menu is maybe the last weeks worth as compared to a list of the most recent ones.

image image

I expected to see a list of my recent past sleeps, and then if there are no sleeps in the last week, it should read zero. Should this be fixed or is this expected?

So I don't think there is any data lost, just that after changing a setting it seems to have refreshed the main page.

vmiklos commented 3 months ago

Should this be fixed or is this expected?

In case you go to the "..." menu -> Settings and dashboard duration is set to "last week", then it's indeed expected that the main activity won't show sleeps other than during the last week.

So at the end this was just confusion on how the app works? Or is there something to fix here?

goldbattle commented 3 months ago

I think it should show zero instead of empty text.

On Tue, Jan 23, 2024, 11:47 AM Miklos Vajna @.***> wrote:

Should this be fixed or is this expected?

In case you go to the "..." menu -> Settings and dashboard duration is set to "last week", then it's indeed expected that the main activity won't show sleeps other than during the last week.

So at the end this was just confusion on how the app works? Or is there something to fix here?

— Reply to this email directly, view it on GitHub https://github.com/vmiklos/plees-tracker/issues/436#issuecomment-1906811314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ6TYUZMLPUB66I3VYEDV3YQAHWTAVCNFSM6AAAAABBEX3JZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBWHAYTCMZRGQ . You are receiving this because you authored the thread.Message ID: @.***>

vmiklos commented 3 months ago

OK, that's finally actionable. :-)