Commit 0368400
committed
Fix race condition destroying terminals when opening terminals view
The cleanup effect in /terminals that removes orphaned worktree terminals
was running before tasks finished loading. Since allTaskWorktrees derives
from tasks (defaulting to []), all worktree terminals appeared orphaned
and were destroyed.
This was triggered by opening the terminals view in a new browser tab -
terminals arrived via WebSocket faster than tasks via HTTP API.
Added isTasksLoading guard to prevent cleanup until tasks are loaded.1 parent 16c6235 commit 0368400
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
0 commit comments