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

Usage of 0 in Time Settings #1

Closed
moriel5 opened this issue Nov 10, 2021 · 5 comments
Closed

Usage of 0 in Time Settings #1

moriel5 opened this issue Nov 10, 2021 · 5 comments
Assignees
Milestone

Comments

@moriel5
Copy link

moriel5 commented Nov 10, 2021

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 ympavlov self-assigned this Nov 11, 2021
@ympavlov ympavlov added this to the 1.9 milestone Nov 11, 2021
@ympavlov
Copy link
Owner

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
Copy link
Author

moriel5 commented Nov 11, 2021

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 added a commit that referenced this issue Dec 6, 2021
@ympavlov
Copy link
Owner

ympavlov commented Dec 9, 2021

Fixed in version 1.9 or later. Unit test added.

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

Thank you for participation.

@ympavlov ympavlov closed this as completed Dec 9, 2021
@moriel5
Copy link
Author

moriel5 commented Dec 9, 2021

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
Copy link
Author

moriel5 commented Dec 9, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants