You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've now reviewed all relevant code. Let me assess the change:
Analysis:
What the PR does: Removes the workerdExperimental flag gate from the jurisdiction property on DurableObjectId, making it unconditionally available.
Backward compatibility: This is purely additive -- it exposes a property that was previously hidden behind an experimental flag. Workers that don't use it won't be affected. The property returns undefined when no jurisdiction is set, so there's no risk of breaking existing code.
The removed TODO: The deleted comment noted TODO(soon): Ensure that jurisdiction is always available on a DurableObjectId. The comment explained the property was experimental because this.ctx.id (the DurableObjectId inside a DO class) wouldn't have jurisdiction set. Looking at DurableObjectState::getId() at actor-state.h:584, it uses Worker::Actor::Id which is kj::OneOf<kj::Own<ActorIdFactory::ActorId>, kj::String>. The string variant wouldn't have jurisdiction. However, this is the same behavior as the name property which can also be undefined, and name is already unconditionally exposed. So the concern in the TODO was about documentation/expectations, not a bug.
Tests: The existing actor-stub-test.js already tests id.jurisdiction (including that it returns undefined when not set), but it runs with the experimental flag. With this change, those tests would pass in the @ (non-experimental) variant too.
TypeScript types: The generated snapshot for latest doesn't include jurisdiction on DurableObjectId, but the experimental snapshot does. The type snapshots will need to be regenerated, but that's a CI/build step, not a code change the PR author needs to make manually in this file.
No compat flag needed: Since this is purely additive (adding a new property that wasn't previously visible) and the underlying implementation already exists and handles the undefined case, this doesn't need a compatibility flag. This is exactly the kind of change the experimental flag is designed for -- graduating something from experimental to stable.
This change is clean and correct. There are no actionable issues.
The generated output of @cloudflare/workers-types has been changed by this PR. If this is intentional, run just generate-types to update the snapshot. Alternatively, you can download the full generated types:
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
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.
No description provided.