Fix task state
Created by: meguiraun
This already includes previos PRs commits! Accept that one first!
I noticed that there was a mismatch regarding the state of the tasks, easy to miss but clear on refresh. Task's states (hopefully everywhere):
- 1: running
- 2: failed (3: warning)
- 4 done