Skip to content

fix: isolate resource execution and subscriber publication - #400

Merged
smiggleworth merged 2 commits into
mainfrom
fix/resource-publication-isolation
Sep 6, 2026
Merged

fix: isolate resource execution and subscriber publication#400
smiggleworth merged 2 commits into
mainfrom
fix/resource-publication-isolation

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

A resource subscriber exception could stop remaining notifications or be mistaken for an async loader failure. Abort handlers, pending subscribers, synchronous loaders, and error coercion could refresh or dispose the resource while the superseded execution continued publishing.

Each execution now establishes controller ownership before abort callbacks and validates that ownership after callback boundaries. Sync values and errors receive the same freshness checks as async completions. Promise rejection handling is separated from success publication; subscriber and logger failures cannot interrupt delivery. Thenable inspection and Promise assimilation failures use the loader error contract. Error normalization completes before publication eligibility is rechecked, and coercion failures settle without escaping the promise handler.

Thirteen new regressions cover notification isolation, logger failures, sync reentry, pending disposal, abort-handler refresh, self-abort, thenable inspection, promise assimilation, and error coercion. TDD established seven initial failures, an additional throwing-getter failure, and three review regressions before their fixes. The existing successful thenable test remains green.

Validation at bdb62d8, rebased onto merged root and query fixes: 14 focused tests, format, lint/typecheck, build, 336 unit / 60 repository / 1632 DOM / 53 browser tests, public types, and 21 packed-consumer tests pass. The unchanged 256 KiB hydration bundle limit passes.

The existing resource-named tier-2 benchmark exercises createQuery rather than ResourceCell. It provides adjacent cancellation coverage and does not establish resource performance improvements.

@smiggleworth
smiggleworth marked this pull request as draft September 6, 2026 20:36
@smiggleworth
smiggleworth force-pushed the fix/resource-publication-isolation branch from 0e50273 to bdb62d8 Compare September 6, 2026 20:54
@smiggleworth
smiggleworth marked this pull request as ready for review September 6, 2026 20:57
@smiggleworth
smiggleworth merged commit 3db219a into main Sep 6, 2026
7 checks passed
@smiggleworth
smiggleworth deleted the fix/resource-publication-isolation branch September 6, 2026 21:01
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