cloudflare / cloudflare/actors
Proper instance not being removed with `.destroy()`
- 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
Assessment
This issue has not been assessed yet.