Skip to content

Commit 1b45b60

Browse files
lukevalentaOxyjun
authored andcommitted
[Durable Objects] Explain that ctx.id.name is undefined within Durable Object constructor (#23558)
* [Durable Objects] Explain that ctx.id.name is undefined within Durable Object constructor * Update src/content/docs/durable-objects/api/id.mdx --------- Co-authored-by: Jun Lee <[email protected]>
1 parent 2d70514 commit 1b45b60

File tree

1 file changed

+1
-1
lines changed
  • src/content/docs/durable-objects/api

1 file changed

+1
-1
lines changed

src/content/docs/durable-objects/api/id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ console.assert(!id1.equals(id2), "Different unique ids should never be equal.");
5757

5858
### `name`
5959

60-
`name` is an optional property of a `DurableObjectId`, which returns the name that was used to create the `DurableObjectId` via [`DurableObjectNamespace::idFromName`](/durable-objects/api/namespace/#idfromname). This value is undefined if the `DurableObjectId` was constructed using [`DurableObjectNamespace::newUniqueId`](/durable-objects/api/namespace/#newuniqueid).
60+
`name` is an optional property of a `DurableObjectId`, which returns the name that was used to create the `DurableObjectId` via [`DurableObjectNamespace::idFromName`](/durable-objects/api/namespace/#idfromname). This value is undefined if the `DurableObjectId` was constructed using [`DurableObjectNamespace::newUniqueId`](/durable-objects/api/namespace/#newuniqueid). This value is also undefined within the `ctx.id` passed into the Durable Object constructor (refer to [GitHub issue](https://github.com/cloudflare/workerd/issues/2240) for discussion).
6161

6262
```js
6363
const uniqueId = env.MY_DURABLE_OBJECT.newUniqueId();

0 commit comments

Comments
 (0)