cloudflare / cloudflare/actors
Actor this.identifier is not available during blockConcurrencyWhile
- Dominant language
- TypeScript
- Stars
- 422
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The examples and documentation in the code mentions that `this.identifier` should be available (not default) during `blockConcurrencyWhile`, but currently it always is `default`
**To Reproduce**
In both cases, the identifier is `default`.
`whoami` works correctly.
```js
export class MyActor extends Actor {
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
this.ctx.blockConcurrencyWhile(async () => {
console.log('ID: ', this.identifier)
});
}
protected async onInit(): Promise {
super.onInit();
console.log('Actor initialized: ', this.identifier);
}
async whoami(): Promise {
return this.identifier;
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.