Durable Objects - List all instances?

Wondering if there’s a way to list all instances of a DO class? e.g. async static something?

I could see a situation (I’ve done it) where DOs are created, put something in storage, but the ID is lost.

So you can never recreate the instance and delete the storage.

Seems like something necessary for cleaning up accidentally created DO instances while testing?

Not at the moment but it’s being worked on.

You should keep track of the IDs if you want to avoid a situation like that - either using KV or some kind of database.

You can use wrangler publish --delete-class and then wrangler publish --new-class to delete all instances of a class.

You probably shouldn’t be testing in the production environment :wink:

1 Like

You should keep track of the IDs if you want to avoid a situation like that - either using KV or some kind of database.

I do now :wink:

You probably shouldn’t be testing in the production environment :wink:

I set up multiple envs. I don’t consider it production to deploy to my test env worker.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.