ympavlov / minidoro

Android app for Pomodoro Technique users
MIT License
30 stars 3 forks source link

Usage of 0 in Time Settings #1

Closed moriel5 closed 2 years ago

moriel5 commented 2 years ago

Hello, I was curious, so I decided to test out the app, and since I usually try to test unreasonable values, I decided to try getting 0 to be accepted as a valid value (great job on preventing it outright, even if I type 2 digits and then remove the nonzero digit).

Putting in a value of .0 for Work Duration crashes the app, and prevents it from opening until the app's data is cleared.

Print in a value of .0 for anything else crashes the app, and makes the app's settings inaccessible until the app's data is cleared.

ympavlov commented 2 years ago

Thank you, @moriel5 for this tricky bug. Actually there is a check for 0 and empty values. But it doesn't work correctly because of issue: all timings are numberDecimal's, not just numbers. I suppose there's no need to adjust timings more precisely than in minutes. So let's make decimal fraction unacceptable at all. In addition the preference reader should be more reliable to prevent crash on wrong stored preference values (that were acceptable in previous versions).

Importance: Rare case => small Could prevent the app to run => not so small

Will try to fix in next version.

moriel5 commented 2 years ago

No problem, I'm glad to be of help. Hopefully that will be enough.

And I am certainly looking forward to testing the next version.

ympavlov commented 2 years ago

Fixed in version 1.9 or later. Unit test added.

Available in F-Droid, will be available in AppGallery soon.

Thank you for participation.

moriel5 commented 2 years ago

No problem, I'll test this now.

Update: I can verify that 0 and decimals can no longer be entered on their own, even if I attempt to paste it from the clipboard.

moriel5 commented 2 years ago

Oddly enough, since I wanted to try installing 1.8, breaking it, and then updating it, I found that the F-Droid 1.9 can not install on top of the F-Droid 1.8.

Update: It is because the F-Droid 1.9 build was somehow compiled with Android 3.0 as the target (which explains the warning claiming it was built for older versions).

I shall post this as a separate issue.