Skip to content

Ignore inherited Array.prototype properties in session tables - #283

Open
vdhanan wants to merge 1 commit into
cloudflare:mainfrom
vdhanan:fix-array-prototype-session-tables
Open

vdhanan wants to merge 1 commit into
cloudflare:mainfrom
vdhanan:fix-array-prototype-session-tables

Conversation

@vdhanan

@vdhanan vdhanan commented Oct 19, 2026

Copy link
Copy Markdown

capnweb tracks each session's stubs in arrays. when a session shuts down, it loops over those arrays with for...in, which also visits any enumerable property a library added to Array.prototype. drizzle-kit adds one (random), so shutting down a session throws this.imports[i].abort is not a function, and getStats() reports too many stubs.

this loops over Object.keys() instead, which returns only the arrays' own entries. the new test fails without the fix.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 460e003

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

This PR includes changesets to release 1 package
Name Type
capnweb 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

@vdhanan

vdhanan commented Oct 19, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 19, 2026
@clanky-the-clanker

Copy link
Copy Markdown

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

for...in over the import, export, and onBroken tables also visits enumerable
properties added to Array.prototype, so shutdown called abort() on them and
threw. Use Object.keys(), which still skips holes and keeps negative indexes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vdhanan
vdhanan force-pushed the fix-array-prototype-session-tables branch from c7346eb to 460e003 Compare October 19, 2026 07:40

This branch has not been deployed

No deployments
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