onStart() only runs if ensureInitialized is called via Workflow RPC, WebSocket, Fetch, Alarm, wake up, etc. As listed in #1056 :
'In PartyServer, #ensureInitialized() guards were added to fetch(), alarm(), webSocketMessage(), webSocketClose(), and webSocketError(). But _workflow_handleCallback(), _workflow_broadcast(), and _workflow_updateState() are public methods on the Agent class that get called via native Cloudflare DO RPC — they bypass all of those guarded entry points."
Similarly, @callable RPC methods defined by user (eg me) run and onStart() hasn't run yet. Would it be possible to add ensureInitialized guard in callable as well? Currently, I have to put onStart at the top of every callable that needs it (eg SQL table to exist). I know in #1057 this was fixed for workflows specifically but callable is also a native Cloudflare DO RPC which bypasses the entry points.
onStart() only runs if ensureInitialized is called via Workflow RPC, WebSocket, Fetch, Alarm, wake up, etc. As listed in #1056 :
'In PartyServer, #ensureInitialized() guards were added to fetch(), alarm(), webSocketMessage(), webSocketClose(), and webSocketError(). But _workflow_handleCallback(), _workflow_broadcast(), and _workflow_updateState() are public methods on the Agent class that get called via native Cloudflare DO RPC — they bypass all of those guarded entry points."
Similarly, @callable RPC methods defined by user (eg me) run and onStart() hasn't run yet. Would it be possible to add ensureInitialized guard in callable as well? Currently, I have to put onStart at the top of every callable that needs it (eg SQL table to exist). I know in #1057 this was fixed for workflows specifically but callable is also a native Cloudflare DO RPC which bypasses the entry points.