Skip to content

Commit 3772617

Browse files
committed
Fixes setResponseRemaining to Always Set All Responses
Was previously looping over a list that was getting mutated within `setResponse`. This could cause the request to never reply (only relevant for `/bulk` queries)
1 parent fde3c09 commit 3772617

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/job.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class Job {
3838
}
3939

4040
setResponseRemaining(response) {
41-
for (const link of this.remainingLinks) {
41+
// Prevent operating on mutating list size
42+
for (const link of [...this.remainingLinks]) {
4243
this.setResponse(link.link.getParams().a, response);
4344
}
4445
}

0 commit comments

Comments
 (0)