Azure / Azure/azure-functions-durable-js
Durable functions reduce ISO8061's precession if milli second have zero as digit values
- Dominant language
- TypeScript
- Stars
- 142
- Forks
- 66
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 4
Description
### Description
Azure Durable function reduce precession of ISO 8061 date string format.
when ever the ISO date string passed to activity function its converted from higher precession to lower precession
YYYY-MM-DDTHH:MM:SS.SSSZ (actual format ) converted to YYYY-MM-DDTHH:MM:SSZ (lower precession format ) in case millisecond are present as zeros.
Eg:
1. 2021-03-23T00:11:50.111Z // actual format this is not affected.
2. 2021-03-23T00:11:50.000Z ----> 2021-03-23T00:11:50Z // affected and converted into lower precession string
### Expected behavior
> we are passing ISO 8061 date string with precession of millisecond up to 3 digit values it should be preserved across the trigger , orca and activities etc..,
### Actual behavior
> when orchestrator or activity receive a ISO 8061 date string some how its precession is lowered in case if the millisecond parts have zero so the precession is decreased to second level
### Relevant source code snippets
client function:
------------------
const df = require("durable-functions");
async function DHT(context, req) {
const client = df.getClient(context);
const instanceId = await client.startNew(req.params.functionName, undefined, {
date: "2021-06-21T00:00:00.000Z",
});
context.log(`Started orchestration with ID = '${instanceId}'.`);
return client.createCheckStatusResponse(context.bindingData.req, instanceId);
}
module.exports = DHT;
------------------------------------------------------------------------
orchestrator:
-------------------
const df = require("durable-functions");
const DO = df.orchestrator(function* (context) {
const outputs = [];
const { date } = context.df.getInput();
console.log(date);
// Replace "Hello" with the name of your Durable Activity Function.
outputs.push(yield context.df.callActivity("DA", date));
outputs.push(yield context.df.callActivity("DA", date));
outputs.push(yield context.df.callActivity("DA", date));
// returns ["DA Tokyo!", "Hello Seattle!", "Hello London!"]
return outputs;
});
module.exports = DO;
-------------------------------------------------------------------------
Activity:
------------
async function DA(context) {
console.log(`Hello ${context.bindings.name}!`);
return `Hello ${context.bindings.name}!`;
}
--------------------------------------------------------------------------
### Known workarounds
> we added some 1 millisecond or replace last 0 in millisecond to one and we could observe the precession is preserved
### App Details
- **Durable Functions extension version (e.g. v1.8.3)** :1.8.7 (which comes with azure function extension bundle [1.*, 2.0.0))
- **Azure Functions runtime version (1.0 or 2.0)** :3.0 (2.0)
- **Programming language used** :NodeJS
### Screenshots
>

### If deployed to Azure
> we don't want to share app detail but I have shared the sample app complete code I hope that can reduce the issue.
Contributor guide
Research direction
Start with the client, orchestrator, and activity snippets in the issue and run the supplied sample flow with both timestamp examples. Trace the date value across the trigger, orchestration, and activities, then verify that a three-digit millisecond component ending in zeros remains present at each stage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, javascript, typescript
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100