Skip to content

context.df.isReplaying is always undefined #564

Open
@Kosmonaft

Description

Describe the bug
context.df.isReplaying is always undefined.
I'm able to get isReplaying from context.triggerMetadata.isReplaying

Investigative information

To Reproduce

  1. Create new durable functions project in programming model v4 (eg. follow official Azure tutorial: https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-ts-vscode?pivots=nodejs-model-v4))
  2. in src/functions/hello.ts add the following code on the beginning of const helloOrchestrator: OrchestrationHandler
    context.log('-----context.df.isReplaying:', context.df.isReplaying); context.log('-----context.triggerMetadata.isReplaying:', context.triggerMetadata.isReplaying);
  3. Call the orchestrator

Expected behavior
Expecting to get boolean value from context.df.isReplaying

Actual behavior
context.df.isReplaying is always undefined

Screenshots
image

Known workarounds
I believe the correct value for isReplaying is coming context.triggerMetadata.isReplaying

Additional context
I’m trying to build an Azure durable function in TypeScript using the programming model v4.
Sadly during my tests I noticed that every context.log is logged multiple times.

After digging in, I’ve learned that it’s one of the weirdest things in the Durable functions.
However based on Azure documentation about App Logging I should be able to resolve this issue by simply checking if the context.df.isReplaying is false. eg:
if (!context.df.isReplaying) context.log("Calling F1.");

Believe me or not but this is not working.
Every single time I’m getting that context.df.isReplaying is undefined.

After few experiments I’m able to get the correct value for isReplaying but from context.triggerMetadata.isReplaying.
I started thinking that there should be something wrong with how I implemented my durable functions, however even the durable functions starter from Azure documentation is giving me the same result

Is this a bug in the Azure programming model v4 or their documentation is not updated?
Do you think I could rely on context.triggerMetadata.isReplaying?

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 itembugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions