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

Empty database import updates overall balance #1068

Open
kenziebourn opened this issue May 21, 2024 · 4 comments · May be fixed by #1070
Open

Empty database import updates overall balance #1068

kenziebourn opened this issue May 21, 2024 · 4 comments · May be fixed by #1070
Assignees
Labels
bug Something isn't working

Comments

@kenziebourn
Copy link

Describe the issue
A user can import a database which has an array of empty values, and the overall balance incorrectly updates.

To Reproduce
Steps to reproduce the behavior:

  1. You can unzip and download the testdb.ttldb file provided or create one with the contents:
    [ { "type": "flexible", "date": "2023-05-21", "values": [] } ]
  2. Go to Edit > Import Database
  3. Upload testdb.ttldb file
  4. Scroll down to bottom
  5. See error
    image

Expected behavior
When importing a database, I expected that the app would check for an array of empty values before validating, and fail if there is no values in the database file. And even if the app should accept empty values, the overall time balance shouldn't be affected since there is no times entered.

Environment
testdb.zip

  • Node/npm version: Node v18/npm 6 (although not really applicable since im using downloaded web app)
  • OS: Windows 11
  • TTL version: latest v3.0.0
@kenziebourn kenziebourn added the bug Something isn't working label May 21, 2024
@tupaschoal
Copy link
Collaborator

Hi @kenziebourn, thanks for the bug report!

Out of curiosity, how did you end up with a date that has empty entries in the database?

@kenziebourn
Copy link
Author

I created that test database file manually and made the date have empty entries

@kenziebourn
Copy link
Author

Also if possible i'd like to be assigned to this issue

@tupaschoal
Copy link
Collaborator

Done

@kenziebourn kenziebourn linked a pull request Jun 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants