partyserver@0.5.1
·
34 commits
to main
since this release
Patch Changes
-
#381
0274658Thanks @threepointone! - Fix: restore legacy__ps_namestorage fallback for framework bootstrap patterns.0.5.0 moved the legacy storage hydrate into
alarm()only, breaking Cloudflare Agents facets and any other framework that writes__ps_namedirectly before calling__unsafe_ensureInitialized(). Facet DOs are spawned viactx.facets.get(...)rather thanidFromName()and therefore havectx.id.name === undefined; they relied on PartyServer reading the storage record back to populatethis.namebeforeonStart().Changes:
- Move the legacy
__ps_namehydrate fromalarm()into#ensureInitialized(), still gated on!ctx.id.name && !#_nameso it costs nothing on the happy path (normalidFromName()/getByName()DOs skip the storage read entirely). Server.fetch()now delegates to#ensureInitialized()for the hydrate instead of doing its own. Thex-partykit-roomheader fallback remains as a last resort when neitherctx.id.namenor a legacy storage record is available.Server.alarm()is simplified — it no longer needs its own hydrate call since#ensureInitialized()handles it.setName()'s@deprecateddocblock is softened to clarify that it remains appropriate for framework-level bootstrap of non-idFromNameDOs (e.g. Agents facets), not just a deprecated compatibility shim.
- Move the legacy