Skip to content

fix(quickstart): enable batching in mass-payout.js#444

Open
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix-mass-payout-batching
Open

fix(quickstart): enable batching in mass-payout.js#444
Kubudak90 wants to merge 1 commit into
coinbase:masterfrom
Kubudak90:fix-mass-payout-batching

Conversation

@Kubudak90
Copy link
Copy Markdown

Problem

The sendMassPayout function was awaiting each transfer inside the for-await loop (line 79), which prevented the SDK from batching transfers efficiently. This caused sequential processing instead of parallel execution.

Solution

  • Collect all transfers in an array first
  • Wait for all transfers to complete after queuing
  • This allows the SDK to batch operations and improves performance when processing multiple payouts

Changes

  • Added pendingTransfers array to store transfer objects
  • Queue all transfers first without blocking
  • Process completion checks after all transfers are queued
  • Improved error handling with clearer log messages

Testing

This is a quickstart template change. The logic maintains the same functionality while improving performance.

Fixes #416

@cb-heimdall
Copy link
Copy Markdown

cb-heimdall commented Apr 7, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

The original code waited for each transfer to complete inside the loop,
which defeated the purpose of batching. This fix:

1. Collects all transfers first without waiting for confirmation
2. Waits for all transfers to complete in a separate loop
3. Improves performance by allowing parallel processing
4. Adds better error handling for each phase

Fixes coinbase#416
@Kubudak90 Kubudak90 force-pushed the fix-mass-payout-batching branch from f9ab429 to c423156 Compare April 7, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

mass-payout.js (not batching?)

2 participants