Skip to content

Conversation

@tuphan-dn
Copy link
Contributor

This PR fixes a bug where the timeout in waitForUserOperationReceipt was not properly cleared after the receipt was returned or an error occurred. This could cause unnecessary delayed executions or memory leaks in long-running applications.

What this PR does:

  • Calls clearTimeout(timer) once the promise resolves or rejects.
  • Ensures the timer is properly cleaned up to prevent leaks and race conditions.

Why it matters:
Without clearing the timeout, the process may retain references to the pending timer callback. For example, when waitForUserOperationReceipt is used in a vitest test, the test may hang for up to 120,000 ms (the default timeout) because the testing framework detects ongoing I/O operations that were never cleared.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest commit: ddee030

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

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

@jxom
Copy link
Member

jxom commented Oct 28, 2025

Please add a changeset.

pnpm changeset

@tuphan-dn
Copy link
Contributor Author

tuphan-dn commented Oct 29, 2025

Please add a changeset.

pnpm changeset

@jxom Changeset was added

@tuphan-dn
Copy link
Contributor Author

@jxom any update mate?

@jxom jxom merged commit eb5fb88 into wevm:main Nov 6, 2025
2 checks passed
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.

2 participants