[Durable Objects] Add changelog for ctx.id.name support#30843
Conversation
Add changelog entry dated 2026-03-26 documenting that ctx.id.name is now populated inside a Durable Object when accessed via idFromName() or getByName(), matching the name visible on the client-side stub.
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
Preview URL: https://64860fe9.preview.developers.cloudflare.com Files with changes (up to 15) |
| date: 2026-03-26 | ||
| --- | ||
|
|
||
| `ctx.id.name` inside a Durable Object now matches what you see client-side. If a 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. |
There was a problem hiding this comment.
Lead with your second sentence. The first sentence is confusing to a user - what is "what you see client-side".
When your Worker accesses a Durable Object via getByName()oridFromName(), ...
- good to frame direct to user
|
|
||
| `ctx.id.name` inside a Durable Object now matches what you see client-side. If a 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. | ||
|
|
||
| Previously, the TypeScript type for `ctx.id` declared `name` as `string | undefined`, which led developers and LLM-based coding assistants to assume the name would be available inside the Durable Object. In reality, it was always `undefined` from inside, forcing manual workarounds. |
There was a problem hiding this comment.
- let's remove focus on what wasn't supported, distracts here. Instead can emphasize this now correctly matches the Workers runtime types
|
|
||
| ```js | ||
| export class ChatRoom extends DurableObject { | ||
| async fetch(request) { |
There was a problem hiding this comment.
feature a RPC method over fetch()
| products: | ||
| - durable-objects | ||
| - workers | ||
| date: 2026-03-26 |
There was a problem hiding this comment.
The note on https://wiki.cfdata.org/spaces/PS/blog/2026/05/15/1406850466/Cloudflare+Observability+Where+we+go+from+here mentions 2026-03-15 so should these dates match?
There was a problem hiding this comment.
hey @vy-ton did you add the correct link here?
There was a problem hiding this comment.
struggling to find what I was looking at, should just confirm @maxmcd when ctx.id.name was first available
There was a problem hiding this comment.
2026-03-15 is the notable date: https://developers.cloudflare.com/durable-objects/api/id/#name
|
|
||
| A few things to note about when `ctx.id.name` is set: | ||
|
|
||
| - **Populated** when the Durable Object is accessed via `idFromName()` or `getByName()`. |
There was a problem hiding this comment.
already said so can remove to avoid repeat
I would mention something about alarms - we want users to understand that ctx.id.name is something that is available no matter how the DO is invoked. For example, the passing in name as arguement doesnt work for alarms
There was a problem hiding this comment.
Does ctx.id.name work locally?
There was a problem hiding this comment.
| - **Populated** when the Durable Object is accessed via `idFromName()` or `getByName()`. | ||
| - **`undefined`** for Durable Objects created with `newUniqueId()`. | ||
| - **`undefined`** when accessed via `idFromString()`, even if the ID was originally created from a name. | ||
| - **`undefined`** for names longer than 1,024 bytes. |
There was a problem hiding this comment.
This raises user question of what the limit for DO names are. Let's make sure thats documented
…30897) 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. Co-authored-by: iglesiasbrandon <5313116+iglesiasbrandon@users.noreply.github.com>
Summary
Adds a changelog entry dated 2026-03-26 documenting that
ctx.id.nameis now populated inside a Durable Object when accessed viaidFromName()orgetByName().The entry:
ctx.id.namevalue now matches what the client sees on the stub's ID.namewould be populated, but it was alwaysundefinedinside the Durable Object).nameisundefined(unique IDs,idFromString(), names > 1024 bytes).References
DurableObjectId::id.namedoesn't work workerd#2240