Skip to content

[vitest-pool-workers] Install wrapper prototype proxy once - #15106

Open
thinkter wants to merge 1 commit into
cloudflare:mainfrom
thinkter:fix/vitest-prototype-proxy-15092
Open

[vitest-pool-workers] Install wrapper prototype proxy once#15106
thinkter wants to merge 1 commit into
cloudflare:mainfrom
thinkter:fix/vitest-prototype-proxy-15092

Conversation

@thinkter

@thinkter thinkter commented Aug 9, 2026

Copy link
Copy Markdown

Fixes #15092.

Summary

Preserve the delayed wrapper-prototype proxy installation required by workerd introspection, while guarding it so each wrapper class installs exactly one proxy. Later constructions now reuse that prototype instead of wrapping the previous proxy and accumulating get traps. The existing trap behavior for inherited, ignored, symbol, and unknown RPC properties is unchanged.

Regression coverage

Added deterministic package-level tests that compare prototype identity before the first construction, after the first construction, and after a later construction. The tests also cover inherited properties, unknown RPC-property delegation, and the ignored self and symbol cases without relying on timing or source-text assertions.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this fixes internal wrapper lifecycle behavior without changing the public API.

Validation:

  • pnpm --filter @cloudflare/vitest-pool-workers exec vitest run test/proxy-prototype.test.ts (2 tests passed)
  • pnpm --filter @cloudflare/vitest-pool-workers check:type
  • pnpm exec oxfmt --check packages/vitest-pool-workers/src/worker/entrypoints.ts packages/vitest-pool-workers/src/worker/proxy-prototype.ts packages/vitest-pool-workers/test/proxy-prototype.test.ts .changeset/lazy-prototype-proxy.md

Note

This is a contribution from an AI agent: OpenAI Codex, GPT-5.6.


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7b9bf1a

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/vitest-pool-workers 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

@workers-devprod
workers-devprod requested review from a team and emily-shen and removed request for a team August 9, 2026 17:40
@workers-devprod

workers-devprod commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@thinkter
thinkter force-pushed the fix/vitest-prototype-proxy-15092 branch from c1b0622 to 7b9bf1a Compare August 9, 2026 18:48
@dario-piotrowicz
dario-piotrowicz requested review from dario-piotrowicz and removed request for emily-shen August 11, 2026 11:11
@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15106

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15106

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15106

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15106

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15106

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15106

miniflare

npm i https://pkg.pr.new/miniflare@15106

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15106

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15106

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15106

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15106

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@15106

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15106

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15106

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15106

wrangler

npm i https://pkg.pr.new/wrangler@15106

commit: 7b9bf1a

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for the fix @thinkter 😄

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

3 participants