Repository navigation
fix(sdk): add timeout and reject path to waitForFillByDepositTx - #273
devtechedge wants to merge 1 commit into
Conversation
Stop infinite polling by rejecting with WaitForFillTimeoutError after a configurable timeout (default 5 minutes). Fixes #271
|
@devtechedge is attempting to deploy a commit to the UMA Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Hello - gentle follow-up on this wait-for-fill timeout work when bandwidth allows.
The PR adds a reject path and a configurable Unit tests cover the timeout rejection path, and the change sits in Glad to tweak the default, error type, or docs if maintainers want a different shape - whenever it fits the queue is fine. |
Summary
waitForFillByDepositTxpreviously returned a Promise with only a resolve path. Polling continued forever on both "not yet filled" and unexpected errors, which could hang callers and keep the event loop alive indefinitely.This change adds a reject path and a configurable
timeout(default 5 minutes). When the deadline is reached, the Promise rejects withWaitForFillTimeoutErrorfor the usual pending-fill case (NoFillLogError), or with the underlying error for other failures.Changes
timeoutparam towaitForFillByDepositTx(defaultDEFAULT_WAIT_FOR_FILL_TIMEOUT_MS= 300000)WaitForFillTimeoutErrorwhen polling exceeds the deadlineTest plan
vitest run test/unit/actions/waitForFillByDepositTx.test.ts(timeout rejection + default timeout constant)timeoutexplicitlyFixes #271