* Atomically mark a task as notified. Returns true if this call flipped the * flag (caller should enqueue), false if already notified (caller should skip).
(taskId: string, setAppState: SetAppState)
| 187 | * flag (caller should enqueue), false if already notified (caller should skip). |
| 188 | */ |
| 189 | function markTaskNotified(taskId: string, setAppState: SetAppState): boolean { |
| 190 | let shouldEnqueue = false; |
| 191 | updateTaskState(taskId, setAppState, task => { |
| 192 | if (task.notified) { |
| 193 | return task; |
| 194 | } |
| 195 | shouldEnqueue = true; |
| 196 | return { |
| 197 | ...task, |
| 198 | notified: true |
| 199 | }; |
| 200 | }); |
| 201 | return shouldEnqueue; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Extract the plan content from the remote session log. |
no test coverage detected