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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database got corrupted and created an empty task, deleting it, deleted everything #291

Closed
tasn opened this issue Feb 7, 2018 · 9 comments
Milestone

Comments

@tasn
Copy link

tasn commented Feb 7, 2018

I have searched for existing issues that may be the same as or related to mine. 馃懠

I'm submitting a bug report for version:
DB corruption happened with 1.6.0, the deletion that caused the mass delete: 1.6.2

One day I noticed an empty task in the task list. Clicking on it will open an empty task to edit.
I ignored for a while, fearing it may cause a db corruption if I touch it, until a few days ago, when I decided to try deleting it. Upon deleting it, all of my tasks were deleted too, so a complete database wipe.

I had a backup to restore from, and restore went fine. I since deleted the offending entries manually using sqlite, but here they are for reference, so you can try to figure out what may have introduced them, and how to fix them.

29|1|0|1|598|0|0|28|0|0|0||||||||||
30|2|0|1|198|0||71|0|0|0||||||0||||
36|3|0|1|2|0||0|0|0|0||||||0||||

As you can see, I have 3 notebooks, and it looks like a broken one was created for each.

I still have a copy of the corrupt database, if there's anything you need from it.

I'm using LineageOS 14.1 (Android 7.1.2) on an herolte if that helps.

@nevenz
Copy link
Member

nevenz commented Feb 7, 2018

Hmm strange. There is a root node with level "0" (level should be 6th column in your example), but that node should never appear in the app. And deleting a note also deletes all its sub-notes, so what you describe could happen if that's the note you deleted somehow.

If you still have a full DB before deletion, that could help. "notes" table should be enough. You can set "title" and "content" to an empty string before sending it.

Thanks!

@tasn
Copy link
Author

tasn commented Feb 7, 2018

Sent via email.

@nevenz
Copy link
Member

nevenz commented Feb 7, 2018

Sent via email.

Thanks. I don't see anything wrong with the values, and even when I push it to the emulator and try it, everything looks fine.

Can you still see that one root note with this DB?

@tasn
Copy link
Author

tasn commented Feb 7, 2018

Hm... I wonder if I only saw it in the widget, and not in the task list, because I mostly use the widget.

Could you please try that?

I'd rather not mess up my phone again, now that I finally recovered most of my tasks.

@nevenz
Copy link
Member

nevenz commented Feb 7, 2018

Hm... I wonder if I only saw it in the widget, and not in the task list, because I mostly use the widget.

Widget is a flat list though and you couldn't delete a note from it. Still, looks normal too.

BTW, do you move notes around or cut & paste them a lot? That's the only way to somehow mess things up, though I still don't see how that one root note would be made visible.

@tasn
Copy link
Author

tasn commented Feb 7, 2018

I do neither.

I didn't delete the note directly from the list, I just hit on the note, which opened the edit page, and then deleted it from there.

@nevenz
Copy link
Member

nevenz commented Feb 7, 2018

I didn't delete the note directly from the list, I just hit on the note, which opened the edit page, and then deleted it from there.

Ah right. OK, I'll check out if it's one of those in the widget.

@vityav
Copy link

vityav commented May 11, 2018

Just adding that this is still an issue in 1.6.5. I frequently have a blank item show up in searches and the widget, but not in the actual corresponding notebook. Deleting it deletes the notebook.

Some notes:
I can make it disappear by changing the search, but I haven't found a consistent change that affects it. Currently dropping my search from three notebooks to two gets rid of it, but I've had it show up in two notebook searches before.
Doesn't seem to consistently be first or last element (currently in the middle of a list, though that list also won't let me move items so might be a different issue).
Doesn't show up as text in an exported .org file.
I've never used the cut and paste feature. I do move things up and down in lists occasionally, but they're all single level lists. That said, sometimes I delete something in a single level list and it deletes other items that are definitely not sub-items of it, so maybe mine is just all messed up.

@nevenz
Copy link
Member

nevenz commented May 12, 2018

Currently dropping my search from three notebooks to two gets rid of it, but I've had it show up in two notebook searches before.

Ah, got it, it can be reproduced by simply OR-ing any two (or more) notebooks.

It's SQL operator precedence issue. Root note would show up all notebooks expect the last one. It's fixed now, thanks.

That said, sometimes I delete something in a single level list and it deletes other items that are definitely not sub-items of it, so maybe mine is just all messed up.

Is this a different issue? Is "something" referring to a non-empty note?

@nevenz nevenz added this to the v1.6.6 milestone May 12, 2018
@nevenz nevenz closed this as completed in f2aca4b May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants