Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing strings that look like dates from orquestator to activity changes the time zone #249

Open
afrancoc2000 opened this issue Mar 15, 2021 · 3 comments
Labels
bug Something isn't working Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. P2 Priority 2 item
Milestone

Comments

@afrancoc2000
Copy link

Describe the bug
I have an orchestator that sends an object to an activity that includes strings that look like dates, from localhost (-05:00) if I send a date like '2021-03-15T16:00:00-07:00' it gets changed to '2021-03-15T18:00:00-05:00'.

Investigative information

  • Durable Functions extension version: 2.4.1
  • durable-functions npm module version: ^1.4.6
  • Language (JavaScript/TypeScript) and version: typescript ^3.3.3
  • Node.js version: 10.23

If deployed to Azure App Service

  • Timeframe issue observed: 2021-03-12T10:00:00-05:00 - 2021-03-12T23:00:00-05:00
  • Function ID: Id=2b8e96e0-2ba6-499c-9d87-f6ec1f41db2b
  • Region: East US
  • Orchestration instance ID(s): I don't know

To Reproduce
Steps to reproduce the behavior:

Create an orchestator and an activity

Orchestator

const orchestrator = df.orchestrator(function* (context) {
        const message = [[{
        "fechaMedida":"2021-03-15T16:00:00-07:00",
        "tipoMedicion":"medida"
    }]]
    yield context.df.callActivity('generar-publicar', message);
});

export default orchestrator;

Activity:

const activityFunction: AzureFunction = async function (context: Context): Promise<void> {
    const messages = context.bindings.messages;
    context.log(`messages: ${JSON.stringify(messages)}`);
};

export default activityFunction;

Check the output in the log, the string changes to the time zone of your machine on localhost and to UTC in the server.

messages: [[{"fechaMedida":"2021-03-15T18:00:00-05:00","tipoMedicion":"medida"}]]

Expected behavior
An output log like this:

messages: [[{"fechaMedida":"2021-03-15T16:00:00-07:00","tipoMedicion":"medida"}]]

@davidmrdavid Here is the issue, hope it helps.

For now I am using JSON.stringfy() on the orchestator and JSON.parse on the activity to mitigate the problem.

Thanks.

@cgillum
Copy link
Member

cgillum commented Mar 15, 2021

@davidmrdavid are you familiar with this issue? I feel like I've seen it mentioned before.

@davidmrdavid
Copy link
Collaborator

@cgillum: Yes, this is a known issue that requires changes in the node-worker to completely fix. So far, I have some internal mitigations that are able to get around this, but they're not perfect. I'm looking to merge a node-worker patch soon. However, this specific error instance should be handled by pre-existing mitigations.

Hi @afrancoc2000! Thank you so much for filing this issue. I'll add it to our current sprint and look into it as soon as tomorrow morning PDT. I'll get back to you!

@davidmrdavid davidmrdavid added Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. and removed Needs: Triage 🔍 labels Mar 15, 2021
@davidmrdavid davidmrdavid added this to the 1.4.7 milestone Mar 15, 2021
@davidmrdavid davidmrdavid self-assigned this Mar 15, 2021
@afrancoc2000
Copy link
Author

@cgillum: Yes, this is a known issue that requires changes in the node-worker to completely fix. So far, I have some internal mitigations that are able to get around this, but they're not perfect. I'm looking to merge a node-worker patch soon. However, this specific error instance should be handled by pre-existing mitigations.

Hi @afrancoc2000! Thank you so much for filing this issue. I'll add it to our current sprint and look into it as soon as tomorrow morning PDT. I'll get back to you!

Thanks!

@lilyjma lilyjma added bug Something isn't working P2 Priority 2 item labels Jan 6, 2024
@davidmrdavid davidmrdavid removed their assignment Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Investigation 🔍 A deeper investigation needs to be done by the project maintainers. P2 Priority 2 item
Projects
None yet
Development

No branches or pull requests

4 participants