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.
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.
In the unstable branch:
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.