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

Race when email threads are starred quickly leads to file corruption #1

Open
jmanuel1 opened this issue Mar 19, 2020 · 1 comment
Open
Labels
bug Something isn't working needs reproduction

Comments

@jmanuel1
Copy link
Owner

In the unstable branch:

  • If you star and unstar a bunch of emails very fast, you might corrupt the todo file, like this:
2019-11-09 Security alert for your linked Google Account email/id:t_caNytfAQbvLKagENsatLwdXMQ3EEuGULe3fh1KF59 @emailmail
2019-11-09 Security alert for your linked Google Account email/id:t_caNytfAQbvLKagENsatLwdXMQ3EEuGULe3fh1KF59 @email

Note the duplicated id and the corrupted @emailmail context. I think this is because there are multiple concurrent reads and writes to the file when emails are (un)starred in quick succession. Perhaps all the functions manipulating the file should act transactionally with respect to the file.

@jmanuel1
Copy link
Owner Author

I was able to reproduce the corrupted contexts by unstarring nine emails at once though multi-selection, followed by right-clicking and selecting "Remove Stars." I have yet to reproduce the todo-duplication.

@jmanuel1 jmanuel1 added bug Something isn't working needs reproduction labels May 27, 2020
jmanuel1 added a commit that referenced this issue May 27, 2020
Now, every save/remove of a to-do from the todo.txt is put in a queue which allows only one of those operations at a time.

The reason for this change is described in issue #1. It doesn't fix that issue completely, though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction
Projects
None yet
Development

No branches or pull requests

1 participant