[Durable Objects] Address review feedback on ctx.id.name changelog#30897
Merged
Conversation
Addresses review feedback from #30843: - Rename file and update frontmatter date to 2026-03-15 to match the production rollout date documented in src/content/docs/durable-objects/api/id.mdx. - Lead with the user-facing 'When your Worker accesses...' framing. - Remove the TypeScript-types backstory; emphasize that runtime now matches the Workers runtime types. - Replace the fetch() code example with an RPC method. - Drop the redundant 'Populated' bullet; link the 1,024-byte caveat to the API reference. - Call out alarms as a primary use case. - Note that this works in local development with wrangler dev.
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
vy-ton
approved these changes
May 18, 2026
|
|
||
| When your Worker accesses a Durable Object via `idFromName()` or `getByName()`, the same name is now available on `ctx.id.name` inside the object — no need to pass it through method arguments or persist it in storage. This brings the runtime behavior in line with the [Workers runtime types](/workers/languages/typescript/). | ||
|
|
||
| This is especially useful for [alarms](/durable-objects/api/alarms/), where there is no calling client to pass the name as an argument. When an alarm handler runs, `ctx.id.name` will hold the same name the object was originally accessed with. |
Contributor
There was a problem hiding this comment.
Suggested change
| This is especially useful for [alarms](/durable-objects/api/alarms/), where there is no calling client to pass the name as an argument. When an alarm handler runs, `ctx.id.name` will hold the same name the object was originally accessed with. | |
| This is especially useful for [alarms](/durable-objects/api/alarms/), where there is no calling client to pass the name as an argument. When an alarm handler runs, `ctx.id.name` will hold the same name the object was originally created with. |
Contributor
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.
Summary
Follow-up to #30843 addressing the review comments from @vy-ton.
Changes
2026-03-26-durable-object-id-name.mdx→2026-03-15-durable-object-id-name.mdxto match the production rollout date documented insrc/content/docs/durable-objects/api/id.mdx(the note about pre-2026-03-15 alarms).fetch()code example with an RPC method (getRoomName()) to align with current Durable Objects best practices.undefinedcases list.ctx.id.name(no calling client to pass the name as an argument).ctx.id.nameworks withwrangler devthe same way it does in production.Review thread
#30843 (review)