Skip to content

Actor this.identifier is not available during blockConcurrencyWhile #60

@zekronium

Description

@zekronium

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.

export class MyActor extends Actor<Env> {
    constructor(ctx: DurableObjectState, env: Env) {
        super(ctx, env);

        this.ctx.blockConcurrencyWhile(async () => {
            console.log('ID: ', this.identifier)
        });
    }


    protected async onInit(): Promise<void> {
        super.onInit();
        console.log('Actor initialized: ', this.identifier);
    }

    async whoami(): Promise<string | undefined> {
        return this.identifier;
    }
}

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions