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

Database overwritten when adding new item #43

Closed
jason-lynch opened this issue May 13, 2020 · 2 comments
Closed

Database overwritten when adding new item #43

jason-lynch opened this issue May 13, 2020 · 2 comments

Comments

@jason-lynch
Copy link

Each time I run the-way new and add an item, it overwrites my DB and I end up with one item.

Repro steps:

  1. the-way new and fill in all fields with test
  2. the-way new and fill in all fields with test2
    • The output says Added snippet #1 a second time
  3. the-way list and confirm that only the last snippet has persisted

Repro recording: https://asciinema.org/a/qVGPLqqeFmo8YxCeK5LhoQuQ9

I'm using the-way v0.24.0 on MacOS v10.15.4 with rust v1.40.0 and I installed through cargo.

@Ninjani
Copy link
Member

Ninjani commented May 13, 2020

Oh my, thanks for catching this! Did some late night refactoring and removed a crucial increment_snippet_index line somehow. Fixed this (in release 0.2.5) and added a test for it, definitely need to flesh out the test suite. The db may be corrupted though so would recommend running the-way export, the-way clear and the-way import after upgrading. Thanks for trying it out and reporting issues, I hope you'll enjoy using it.

@jason-lynch
Copy link
Author

Wow! Thanks for the quick fix. Looks like everything is working now after updating to 0.2.5.

And thanks for making this tool! It replaces a hacky script I was using and I can see myself using it frequently.

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