fix: isolate resource execution and subscriber publication - #400
Merged
Conversation
smiggleworth
marked this pull request as draft
September 6, 2026 20:36
smiggleworth
force-pushed
the
fix/resource-publication-isolation
branch
from
September 6, 2026 20:54
0e50273 to
bdb62d8
Compare
smiggleworth
marked this pull request as ready for review
September 6, 2026 20:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.