500 in Todos when commented issue/MR in separate tab

Summary

Given that you have open tab with Todos, and you comment MR/issue in separate tab, then clicking "Done" in Todos tab results in 500.

Steps to reproduce

Go to Todo item without clicking done (open a new tab), leave comment, and click "Done" in Todos tab.

Expected behavior

This should not result in 500.

Relevant logs and/or screenshots

Cannot transition state via :done from :done (Reason(s): State cannot transition via "done")

app/controllers/dashboard/todos_controller.rb in destroy at line 9

todo.done!

Sentry id: 2001

cc @dbalexandre