Skip to content

fix: clearTimeout in waitForUserOperationReceipt - #4058

Merged
jxom merged 3 commits into
wevm:mainfrom
sontuphan:main
Nov 6, 2025
Merged

fix: clearTimeout in waitForUserOperationReceipt#4058
jxom merged 3 commits into
wevm:mainfrom
sontuphan:main

Conversation

@ghost

@ghost ghost commented Oct 28, 2025

Copy link
Copy Markdown

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

changeset-bot Bot commented Oct 28, 2025

Copy link
Copy Markdown

🦋 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

jxom commented Oct 28, 2025

Copy link
Copy Markdown
Member

Please add a changeset.

pnpm changeset

@ghost

ghost commented Oct 29, 2025

Copy link
Copy Markdown
Author

Please add a changeset.

pnpm changeset

@jxom Changeset was added

@ghost

ghost commented Nov 6, 2025

Copy link
Copy Markdown
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.

1 participant