Thanks - well actually things work as expected locally, just not in prod
Thanks - well actually things work as expected locally, just not in prod
await doSomething() which is outside of the class (import function) which does an external async fetch call.if (!res.ok) throw new Error()) then the alarm just dies and no logs appear in console (hence me thinking it wasn't being triggered)await doSomething().catch(e => console.error(e)) and return early, the alarm logs show upalarm() handler should be wrapped in a try-catch.Since DurableObjects are basically in-memory classes, their long-term state cannot be guaranteed - especially in cases which involve the Hibernation API. When the DurableObject hibernates, the existing websocket connections are kept alive "outside" of the class - and when one wakes up, the Workers runtime will reinstantiate the DurableObject with a new state.
// ... During periods of inactivity, the Durable Object can be evicted
// from memory, but the WebSocket connection will remain open. If at some later point the
// WebSocket receives a message, the runtime will recreate the Durable Object
// (run theconstructor) and deliver the message to the appropriate handler.
serializeAttachment / deserializeAttachment to store persistent state?this.ctx.storage.sql.exec("select * from artist where artistname = ?;", "Alice"); safe against sql-injection or do i need to worry about that?
wrangler dev --remote will support SQLite DOs?

await doSomething()if (!res.ok) throw new Error()await doSomething().catch(e => console.error(e))alarm() this.ctx.blockConcurrencyWhile(async () => {
await this.migrate();
});constructorserializeAttachmentdeserializeAttachmentthis.ctx.storage.sql.exec("select * from artist where artistname = ?;", "Alice");The first time you get a Durable Object stub based on an ID derived from a name, the system has to take into account the possibility that a Worker on the opposite side of the world could have coincidentally accessed the same named Durable Object at the same time. To guarantee that only one instance of the Durable Object is created, the system must check that the Durable Object has not been created anywhere else. Due to the inherent limit of the speed of light, this round-the-world check can take up to a few hundred milliseconds.wrangler dev --remote