Patch Changes
-
#1050
6157741Thanks @ask-bonk! - Fix Agent alarm() bypassing PartyServer's initializationThe Agent class defined
alarmas apublic readonlyarrow function property, which completely shadowed PartyServer'salarm()prototype method. This meant#ensureInitialized()was never called when a Durable Object woke via alarm (e.g. fromscheduleEvery), causingthis.nameto throw andonStartto never run.Converted
alarmfrom an arrow function property to a regular async method that callssuper.alarm()before processing scheduled tasks. Also added anonAlarm()no-op override to suppress PartyServer's default warning log. -
#1052
f1e2bfaThanks @ask-bonk! - MakescheduleEvery()idempotentscheduleEvery()now deduplicates by the combination of callback name, interval, and payload: calling it multiple times with the same arguments returns the existing schedule instead of creating a duplicate. A different interval or payload creates a separate, independent schedule.This fixes the common pattern of calling
scheduleEvery()insideonStart(), which runs on every Durable Object wake. Previously each wake created a new interval schedule, leading to a thundering herd of duplicate executions.