-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Desktop: Fixes #11457: Fix crash on startup if old read-only items are in the trash #11458
Desktop: Fixes #11457: Fix crash on startup if old read-only items are in the trash #11458
Conversation
… items are in the trash
Thanks for looking into this but I wonder if this is the right fix. First, a readonly item probably shouldn't have been deleted? Or if it can under certain condition, shouldn't it be made non-readonly and removed from the share? |
Good point — this error seems to indicate an issue exists somewhere else. However, because at least one user's copy of Joplin crashes on startup due to this invalid state, it may make sense to either:
Note Note that a response to the above comment was posted on the forum:
|
Based on the above comment, I feel this is what should be done?
I believe just this change should fix this particular crash? And this change should be removed after a few months because it's only meant to fix invalid data Then we should also review what happens when a shared item is deleted, but that would be a different PR |
Thank you for the feedback! I don't think unsharing would fix the issue — the share recipients would still have invalid data (and may not have permission to unshare the items). To fix the crash, one of the following would likely be necessary:
Of the above, I think that allowing Explanation: When the crash happens, 1) the current user lacks permission to permanently delete items and 2) the crash occurs on startup within
Edited: Reworded and reorganized. (If it still isn't clear, please let me know and I can try to clarify!) |
Ok I think that makes sense to fix this particular crash then. Also to address his comment:
Could you please check what happens when a note in a shared folder is moved to the trash? Do we clear the share_id and is_shared property? As for read-only items, I believe there are checks in place to prevent them from being deleted in general. I think it was only possible in this case maybe due to a bug with share_id not being cleared. |
@personalizedrefrigerator, I've created this issue: #11482 |
Summary
This pull request should fix #11457.
Previously, the trash auto-deletion logic attempted to delete items in the trash even if part of a read-only share. This caused a crash on startup when deleting old items.
Important
Although this issue doesn't seem to be a recent regression, this pull request targets
release-3.1
— this issue is preventing at least one user from starting Joplin.Testing plan
This pull request includes an automated test, but has not been tested manually.
I have verified that, if the changes to
permanentlyDeleteItems.ts
are reverted, then the test fails with: