Support ctx.id.name in local dev for Durable Objects#6421
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR removes the clearName() call that stripped ctx.id.name from Durable Object IDs in workerd's local server, making .name available during local dev for named DOs.
- [LOW] Test coverage gap for unique IDs. The updated test validates that
ctx.id.nameis a non-empty string for named DOs (idFromName), but there's no corresponding test asserting thatctx.id.nameremainsundefinedfor DOs accessed vianewUniqueId(). Since theclearNamecode path previously applied to allkj::Own<ActorIdFactory::ActorId>(which includes both named and unique IDs), it would be good to confirm the unique-ID case is still correct after this change. The existingnewUniqueIdtest at line 1855 doesn't check.nameinside the DO constructor.
This review was generated by an AI assistant and may contain errors. Please verify any suggestions before applying them.
|
Review posted successfully on PR #6421. Summary: The PR cleanly removes the |
c0bb743 to
fe1a2cf
Compare
|
Is there a way to test this? |
fe1a2cf to
0a6619a
Compare
|
@shrima-cf I added some more testing and left a clearer comment. Let me know what you think. |
LGTM. As discussed, add a test for the happy path |
0a6619a to
76ac842
Compare
We now have support for ctx.id.name in Durable Objects. This PR removes the
clearName()call in local dev that was simulating how the platform works by removing the name from the id. Now that we have support, we can keep the name.The
nameis still missing from alarm invocations that wake up after the local isolate has shut down. I'll handle that work in a follow-up PR.