Skip to content

Proper instance not being removed with .destroy() #23

@Brayden

Description

@Brayden

The identifier of the object is not being properly accessed when a destroy operation is attempted. If you log out this.identifier in the Actor destroy() method you will read out default even if you have the following code:

export class MyWorker extends Worker<Env> {
    async fetch(request: Request): Promise<Response> {
        const deleteActor = MyDurableObject.get('foobar')
        deleteActor?.destroy({ trackingInstance: '_cf_actors' });
        
        const actor = MyDurableObject.get('_cf_actors');
        const value = await actor!.sql`SELECT * FROM actors;`
        return new Response(`Query: ${JSON.stringify(value)}`)
    }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions