Azure / Azure/azure-functions-durable-js

Add durable-specific serialization logic in the nodeJS worker

Open
#245 0 comments 0 reactions 0 assignees View on GitHub
bug dependencies P2
Dominant language
TypeScript
Stars
142
Forks
66
Avg merge
3d 19h
Merged PRs (30d)
4

Description

In [this](https://github.com/Azure/azure-functions-durable-js/issues/231#issuecomment-782288805) ticket, we learned that our string-serialization patch [here](https://github.com/Azure/azure-functions-durable-js/blob/c6e1844a3959fc37447c2a364ea0f8833a070852/src/utils.ts#L3) has broken some `function.json` functionality for some of our users.

The patch listed above was a minor "hack" in hopes to avoid changing the nodejs-worker's serialization logic, which could impact all of the JS azure functions infrastructure, not just durable. So while making serialization changes in the worker is often discouraged, in this case, since the new error manifests in a `function.json`, there's no fix we can implement at the Durable-level to get around this: a solution needs to be implemented in the worker.

To minimize impact and legacy behaviour across JS Functions, we can write durable-bindings-specific serialization and de-serialization logic in the worker.

The relevant files to modify are listed below:
* https://github.com/Azure/azure-functions-nodejs-worker/blob/617f3237e2683f2e3cc1e73847540537126ac190/src/FunctionInfo.ts#L34 [to assign a durable-specific encoder/decoder]
* https://github.com/Azure/azure-functions-nodejs-worker/blob/617f3237e2683f2e3cc1e73847540537126ac190/src/WorkerChannel.ts#L239 [to call the encoder]

Contributor guide

Open the contributing guide

Research direction

Start by reviewing src/FunctionInfo.ts to understand where a durable-specific encoder and decoder would be assigned, then inspect src/WorkerChannel.ts around line 239 to see how the encoder is called. Done means durable bindings use their own serialization and deserialization path while existing JavaScript Functions behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, nodejs, typescript
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.