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

Entering habit via notification when clock is set to epoch 0 crashes the app irremediably #1690

Open
2 tasks done
7heo opened this issue Apr 21, 2023 · 3 comments
Open
2 tasks done
Labels
bug Something is not behaving as the developers expected

Comments

@7heo
Copy link

7heo commented Apr 21, 2023

Pre-submission checklist

  • I am submitting a bug report, not a feature request.
  • I have searched for similar issues, but did not find any matches.

Description

My phone started, the clock was set to epoch 0, and uhabits generated notifications (I have no habits data entered for Jan the 1st, 1970). I didn't pay attention to the "53y" due date in the notification and entered my habit.

Now the app won't open. It straight crashes when opening. No display, no nothing. Absolutely unusable. It's a shame, this app is otherwise one of the best ones I ever used. I hope this can be fixed soon, because I don't think I can use the app until it is 😢

I suspect it is possible to totally reset the user data and get the app to work again, but I do not want to lose all my progress. I have been using this app for years.

Steps to reproduce

  1. Set the clock to epoch 0
  2. Wait for habits notifications to appear
  3. Use a notification to enter the habit
  4. Try and open the app
  5. App doesn't open again.

System information

  • Phone Operating System: Android 8.1.0 / LineageOS 15
  • App version: 2.1.1
@7heo
Copy link
Author

7heo commented May 31, 2023

So just to be thorough, I was able to locally "solve" this issue by opening the sqlite database of the app, and deleting the relevant entries:

phone:/data/data/org.isoron.uhabits $ sqlite3 databases/uhabits.db
SQLite version 3.19.4 2018-12-19 17:05:48
Enter ".help" for usage hints.
sqlite> SELECT * FROM Repetitions WHERE timestamp = 0;
4460|16|0|0|
sqlite> DELETE FROM Repetitions WHERE id = 4460;
sqlite>
phone:/data/data/org.isoron.uhabits $

After this, the problem was solved. I could use the app again, normally.

@hiqua hiqua added bug Something is not behaving as the developers expected low-severity labels Jul 3, 2023
@hiqua
Copy link
Collaborator

hiqua commented Jul 3, 2023

For completeness, how did you end up with epoch 0 on your phone?

It's definitely a bug, but hopefully it should be rare enough to be lower priority.

@7heo
Copy link
Author

7heo commented Jul 3, 2023

It happened right after boot. I have a very old phone that has a battery that dies pretty hard sometimes, there is no SIM in the phone, and it can take a while to connect to the WiFi.

So I suppose it was after a cold reboot, with zero battery charge left to maintain the RTC state. and the OS just went with "epoch zero" as it had no way to determine it any better. The OS booted, I got a bunch of notifications, unfortunately validated one, and created a DB entry with epoch zero. I couldn't delete it anymore since the app crashed, and also since the phone then got up to date (pun intended) time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not behaving as the developers expected
Projects
None yet
Development

No branches or pull requests

3 participants