Manually deleting the last item in an encrypted tab does not remove the data from the `.dat` file
- Dominant language
- C++
- Stars
- 12.3k
- Forks
- 593
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
Say we have an encrypted tab with 5 items. On opening the UI and deleting 4 of the items, the `.dat` file is updated accordingly, such that on force close and restart, the deleted items will _not_ be (and _can't be_) reloaded into the tab list.
However, deleting the last item does _not_ result in any change to the `.dat` file. The deleted item's encrypted data is still there, and so on force close and restart, the item _is_ loaded back into the tab list again. This is an issue - the data should be gone.
Interestingly after deleting the final item and then adding a _new item_ to the list _does_ result in an update to the `.dat` file. In this scenario, the deleted item will not be reloaded on restart.
**To Reproduce**
Steps to reproduce the behavior:
1. Copy 5 items into an encrypted tab.
2. Delete 4 of the items.
3. Verify that the `.dat` file in the saved items directory is updated, then force restart CopyQ and check that the 4 deleted items aren't reloaded into the tab list.
4. Delete the final item.
5. The `.dat` file should have been updated again, to remove the encrypted data of the final item. However it hasn't changed. Now force restart CopyQ again. The final item that should have been deleted will be incorrectly reloaded into the tab list.
Note, the issue is also reproducible if _all_ items in the tab are deleted together. In this scenario, _no data_ is removed from the `.dat` file, and on restart _all_ of the items are restored.
**Version, OS and Environment**
- CopyQ 7.0.0
- gpg4win-2.0.4.exe
- Windows 10
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.