cloudflare / cloudflare/actors

Proper instance not being removed with `.destroy()`

Open
#23 1 comment 0 reactions 1 assignee Claimed by @Brayden View on GitHub
bug
Dominant language
TypeScript
Stars
422
Forks
28
PR merge metrics
No merged PRs in 30d

Description

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:

```typescript
export class MyWorker extends Worker {
async fetch(request: Request): Promise {
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)}`)
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.