Skip to content

fix: backport TSFN delivery hardening to v1#222

Draft
Brooooooklyn wants to merge 6 commits into
toyobayashi:v1.xfrom
Brooooooklyn:codex/emnapi-v1-backport
Draft

fix: backport TSFN delivery hardening to v1#222
Brooooooklyn wants to merge 6 commits into
toyobayashi:v1.xfrom
Brooooooklyn:codex/emnapi-v1-backport

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport the production TSFN delivery, retirement, memory-view, and context-lifecycle hardening from #220 to the maintained v1.x line.

Scope

  • generation-scoped TSFN delivery and retirement across workers;
  • ambiguous transport/retry ownership and bounded reclamation;
  • scheduler, worker-loss, cleanup-hook, and teardown hardening;
  • refreshed shared/unshared WebAssembly memory views after reentrancy and allocation growth;
  • non-spoofable shared-memory brand detection without requiring a local SharedArrayBuffer constructor;
  • configurable context autoDestroy;
  • MessageChannel-independent Node keepalive with paired timer cancellation;
  • exception- and reentrancy-safe host ref/unref/timer handling;
  • focused adversarial TSFN, generated-library, Buffer allocation-growth, and Context regression coverage.

Stack status

Verification

Passed locally on July 8, 2026:

  • npm run build:main
  • npm run build:core
  • npm run build:runtime
  • npm run build:node
  • runtime Context suite: 19/19
  • focused TSFN backport and threaded delivery tests
  • Buffer allocation-growth regression
  • changed-file ESLint
  • git diff --check

The v2-only V8/plugin files and v8_memory_growth.test.js do not exist on v1.x; equivalent memory-growth and host-lifecycle coverage is adapted to the v1 CommonJS/context layout.

Related

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