Skip to content

fix(sdk): add timeout and reject path to waitForFillByDepositTx - #273

Open
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/wait-for-fill-timeout
Open

fix(sdk): add timeout and reject path to waitForFillByDepositTx#273
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/wait-for-fill-timeout

Conversation

@devtechedge

Copy link
Copy Markdown

Summary

waitForFillByDepositTx previously 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 with WaitForFillTimeoutError for the usual pending-fill case (NoFillLogError), or with the underlying error for other failures.

Changes

  • Add timeout param to waitForFillByDepositTx (default DEFAULT_WAIT_FOR_FILL_TIMEOUT_MS = 300000)
  • Reject via WaitForFillTimeoutError when polling exceeds the deadline
  • Keep retrying until the timeout so transient indexer/RPC misses still have a chance to succeed
  • Add unit tests covering the timeout rejection path

Test plan

  • vitest run test/unit/actions/waitForFillByDepositTx.test.ts (timeout rejection + default timeout constant)
  • Reviewers: confirm 5 minute default is reasonable for the indexer fallback path, or suggest a different default
  • Reviewers: confirm callers that need longer waits can pass timeout explicitly

Fixes #271

Stop infinite polling by rejecting with WaitForFillTimeoutError after a
configurable timeout (default 5 minutes). Fixes across-protocol#271
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

@devtechedge is attempting to deploy a commit to the UMA Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 803abb7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

waitForFillByDepositTx: infinite polling loop with no termination condition, errors swallowed

1 participant