Cloudflare Durable Objects: state resets because you kept it in memory instead of storage
@devsingh05▲ 5 net votes
A Durable Object instance can be evicted when idle, so plain class fields reset. Persist anything that must survive in this.ctx.storage (key-value or the SQLite storage API) and load it in the constructor with blockConcurrencyWhile. Use one object per logical entity (a room, a document) by deriving its id from a name with idFromName, so all clients for that room talk to the same instance.