Local Explorer starts a Durable Object without ctx.id.name, and later named calls do not restore it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- devtools
Research direction
Start by reproducing the two cases in the issue: Local Explorer starts the object first, and idFromString() starts it first. Trace how Local Explorer starts a Durable Object and how later getByName() or idFromName() calls reach it; the report names no source files or tests. Done when a later named call returns the expected name, or Local Explorer starts the object without losing it.
Written by the indexing model from the issue text.
Description
Summary
If the Local Explorer (or any idFromString() call) is the first thing to start a Durable Object, ctx.id.name stays undefined for the whole life of that instance. Later requests that reach the object by name (getByName() / idFromName()) do not restore it. A restart of wrangler dev clears it.
The docs say ctx.id.name is undefined when the object is reached through idFromString() (changelog). This report is about what happens after that: the name is still missing on later calls that do have the name.
Reproduction
Minimal project: one Worker, one SQLite-backed DO with whoami() { return { name: this.ctx.id.name ?? null } }.
Routes: /hex-of/:name (returns idFromName(name).toString(), does not start the object), /by-name/:name (getByName(name).whoami()), /by-hex/:hex (get(idFromString(hex)).whoami()).
wrangler 4.160.1, compatibility_date 2026-03-20, macOS arm64.
Case 1 - Local Explorer starts the object first
HEX=$(curl -s localhost:8799/hex-of/carol | jq -r .hex)(id only, no object is started)- Open
http://localhost:8799/cdn-cgi/local/explorer/do/Counter/$HEXin a browser. curl localhost:8799/by-name/carolreturns{"name":null,...}. Expected"carol".
Case 2 - no explorer, idFromString() first
HEX=$(curl -s localhost:8799/hex-of/alice | jq -r .hex)curl localhost:8799/by-hex/$HEXreturns{"name":null}(documented).curl localhost:8799/by-name/alicereturns{"name":null}. Expected"alice".
Control - named call first
/by-name/bob returns "bob", and a later /by-hex/<bob's hex> still returns "bob". So the first caller decides, and it is never updated.
Expected
Either a later call through idFromName() / getByName() restores ctx.id.name, or the Local Explorer starts the object in a way that keeps the name.
Impact
Code that reads ctx.id.name in a method (as the docs recommend) throws or misbehaves for the rest of the dev session after one look at the object in the Local Explorer. We hit this with a DO whose id is its name: opening it in the explorer broke every later app request to it until wrangler dev was restarted.
Notes
- Not tested in production; I only know of the local behavior.
- Possibly related: cloudflare/workerd#7286 (proxy drops
ctx.id.name).
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cloudflare/workers-sdk#17189 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#17187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cloudflare/workers-sdk#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#17174 ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days