fix: ensure map iteration order is correct (#16947)

quick follow-up to #16944
Resetting a map entry does not change its position in the map when iterating. We need to make sure that reset makes that batch jump "to the front" for the "reject all stale batches" logic below. Edge case for which I can't come up with a test case but it _is_ a possibility.
pull/16949/head
Simon H 3 days ago committed by GitHub
parent 28765f846e
commit 99711d5822
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -144,6 +144,7 @@ export function async_derived(fn, location) {
batch.increment();
deferreds.get(batch)?.reject(STALE_REACTION);
deferreds.delete(batch); // delete to ensure correct order in Map iteration below
deferreds.set(batch, d);
}
}

Loading…
Cancel
Save