Skip to content

Make DO id.jurisdiction property non-experimental#6324

Open
maxmcd wants to merge 1 commit intomainfrom
mmcdonnell/STOR-4870-non-exp-jurisdiction
Open

Make DO id.jurisdiction property non-experimental#6324
maxmcd wants to merge 1 commit intomainfrom
mmcdonnell/STOR-4870-non-exp-jurisdiction

Conversation

@maxmcd
Copy link
Contributor

@maxmcd maxmcd commented Mar 14, 2026

No description provided.

@maxmcd maxmcd requested review from a team as code owners March 14, 2026 23:14
@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 14, 2026

I've now reviewed all relevant code. Let me assess the change:

Analysis:

  1. What the PR does: Removes the workerdExperimental flag gate from the jurisdiction property on DurableObjectId, making it unconditionally available.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

LGTM

github run

@github-actions
Copy link

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:

Full Type Diff
diff -r types/generated-snapshot/latest/index.d.ts bazel-bin/types/definitions/latest/index.d.ts
585a586
>   readonly jurisdiction?: string;
diff -r types/generated-snapshot/latest/index.ts bazel-bin/types/definitions/latest/index.ts
587a588
>   readonly jurisdiction?: string;

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.

2 participants