Repository navigation
Conversation
Author
|
Is there anything I should change to get this ready to merge? Happy to rebase or adjust. |
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.
Fixes #259
Problem
When a Durable Object is constructed while its container is already running, the constructor starts outbound interception inside
blockConcurrencyWhileand stores the promise inapplyOutboundInterceptionPromisewithout anything awaiting it. IfapplyOutboundInterception()rejects, the rejection is unobserved and becomes anunhandledRejectionthat a subclass cannot catch.Fix
Attach a
.catchat the call site that logs the error. The stored promise stays rejected, andrefreshOutboundInterception()still re-applies and awaits its own copy, so thestart()and runtime-config paths keep surfacing the error to the caller.I did not await it inside
blockConcurrencyWhile: per the Durable Objects docs, a throw there terminates and resets the object, which would turn a degraded interception setup into a crash loop.Adds a unit test in
src/tests/(mocked ctx, no Docker) and a patch changeset.Testing
Tests:
npx vitest run src/tests-> 35 passed; with thecontainer.tschange stashed, the new test fails and vitest reportsUnhandled Rejection: Error: intercept failed. Not run against wrangler dev or Docker.