From 30da810213bbbd75928ddf0461c7eed4a9c21555 Mon Sep 17 00:00:00 2001 From: BlankParticle Date: Tue, 29 Jul 2025 00:18:32 +0530 Subject: [PATCH 1/2] chore: remove redundant initialize code --- packages/partyserver/src/index.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/packages/partyserver/src/index.ts b/packages/partyserver/src/index.ts index 75048bdb..a0d1d008 100644 --- a/packages/partyserver/src/index.ts +++ b/packages/partyserver/src/index.ts @@ -377,12 +377,6 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam await this.setName(connection.server); // TODO: ^ this shouldn't be async - if (this.#status !== "started") { - // This means the server "woke up" after hibernation - // so we need to hydrate it again - await this.#initialize(); - } - return this.onMessage(connection, message); } @@ -398,11 +392,6 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam await this.setName(connection.server); // TODO: ^ this shouldn't be async - if (this.#status !== "started") { - // This means the server "woke up" after hibernation - // so we need to hydrate it again - await this.#initialize(); - } return this.onClose(connection, code, reason, wasClean); } @@ -413,11 +402,6 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam await this.setName(connection.server); // TODO: ^ this shouldn't be async - if (this.#status !== "started") { - // This means the server "woke up" after hibernation - // so we need to hydrate it again - await this.#initialize(); - } return this.onError(connection, error); } @@ -496,9 +480,7 @@ Did you try connecting directly to this Durable Object? Try using getServerByNam this.#_name = name; if (this.#status !== "started") { - await this.ctx.blockConcurrencyWhile(async () => { - await this.#initialize(); - }); + await this.#initialize(); } } From 3801b5e49d843947fa7c886b2d21c173433bc1a8 Mon Sep 17 00:00:00 2001 From: BlankParticle Date: Tue, 29 Jul 2025 00:22:59 +0530 Subject: [PATCH 2/2] add changeset --- .changeset/evil-carrots-grab.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/evil-carrots-grab.md diff --git a/.changeset/evil-carrots-grab.md b/.changeset/evil-carrots-grab.md new file mode 100644 index 00000000..684882fd --- /dev/null +++ b/.changeset/evil-carrots-grab.md @@ -0,0 +1,5 @@ +--- +"partyserver": patch +--- + +remove redundant initialize code as setName takes care of it, along with the nested blockConcurrencyWhile call