(commandQueue: Deque<CommandItem>)
| 157 | // example, if the queue looks like this: [2, 3, 4, 0, 1, 2] then after |
| 158 | // aborting and purging we'll have a queue that looks like this: [0, 1, 2] |
| 159 | function abortIncompletePipelines(commandQueue: Deque<CommandItem>) { |
| 160 | let expectedIndex = 0; |
| 161 | for (let i = 0; i < commandQueue.length; ) { |
| 162 | const command = commandQueue.peekAt(i)?.command as Command; |
| 163 | const pipelineIndex = command.pipelineIndex; |
| 164 | if (pipelineIndex === undefined || pipelineIndex === 0) { |
| 165 | expectedIndex = 0; |
| 166 | } |
| 167 | if (pipelineIndex !== undefined && pipelineIndex !== expectedIndex++) { |
| 168 | commandQueue.remove(i, 1); |
| 169 | command.reject(abortError(command)); |
| 170 | continue; |
| 171 | } |
| 172 | i++; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // If only a partial transaction result was received before connection close, |
| 177 | // we have to abort any transaction fragments that may have ended up in the |
no test coverage detected
searching dependent graphs…