Commit b6639ad
committed
fix: correct array txid handling in electric collection handlers
The bug was in processMatchingStrategy when handling arrays of txids.
Using `.map(awaitTxId)` directly caused Array.map() to pass three
arguments (element, index, array), and the index was being interpreted
as the timeout parameter of awaitTxId.
For example:
- awaitTxId(txid1, 0) → timeout 0ms (immediate timeout!)
- awaitTxId(txid2, 1) → timeout 1ms (immediate timeout!)
This caused TimeoutWaitingForTxIdError even though the txids were
being sent correctly via the sync stream.
The fix uses an arrow function to ensure only the txid is passed:
await Promise.all(result.txid.map((txid) => awaitTxId(txid)))
This allows the timeout to use its default value of 5000ms.
Fixes #7931 parent 3bdb5ab commit b6639ad
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
510 | 511 | | |
511 | 512 | | |
512 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
| 714 | + | |
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| |||
0 commit comments