Skip to content

fix(browser-vm): clean up completed timeout records#762

Open
2heal1 wants to merge 1 commit into
web-infra-dev:mainfrom
2heal1:fix/browser-vm-timeout-leak
Open

fix(browser-vm): clean up completed timeout records#762
2heal1 wants to merge 1 commit into
web-infra-dev:mainfrom
2heal1:fix/browser-vm-timeout-leak

Conversation

@2heal1

@2heal1 2heal1 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove completed one-shot timers from sandbox tracking.
  • Clear timer and interval records during sandbox recovery.
  • Preserve callback arguments, callback context, and string handler support.
  • Add regression tests for timer cleanup behavior.

Problem

The browser-vm timer module retained timeout records after their callbacks had already completed. In long-lived sandboxes, these stale records could accumulate until the JavaScript engine reached the Set size limit and threw:

RangeError: Set maximum size exceeded

Testing

  • All 55 browser-vm tests passed.
  • All 5 timer regression tests passed.
  • The browser-vm package build passed.
  • Formatting and code checks passed.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@2heal1 is attempting to deploy a commit to the garfish Team on Vercel.

A member of the Team first needs to authorize it.

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