Effect CommunityEC
Effect Community4mo ago
8 replies
bismuth1991

MalformedMessage when re-execute duplicated workflow

I'm testing workflow using the basic EmailWorkflow example. When I tried to re-execute the workflow with duplicate message, I got the following MalformedMessage error.

MalformedMessage: { "cause": ({ readonly _tag: "WithExit"; readonly requestId: (string <-> bigint); readonly id: (string <-> bigint); readonl
y exit: (ExitEncoded<void, never, Defect> <-> Exit<void, never>) } <-> <declaration schema>) | never
  ├─ ({ readonly _tag: "WithExit"; readonly requestId: (string <-> bigint); readonly id: (string <-> bigint); readonly exit: (ExitEncoded<void,
 never, Defect> <-> Exit<void, never>) } <-> <declaration schema>)
  │  └─ ["_tag"]
  │     └─ Expected "WithExit", actual "Chunk"
  └─ Expected never, actual {"id":"97567104621875200","requestId":"97567091229732864","_tag":"Chunk","sequence":0,"values":{"_tag":"Success"}}
}
...
at .../node_modules/@effect/cluster/src/MessageStorage.ts:410:39


The error is originated from here https://github.com/Effect-TS/effect/blob/main/packages/cluster/src/MessageStorage.ts#L410

Could someone help me debug this, please? My expectation was that the worflow succeeded with prev result, or failed with catchable error (via Effect.catchTag)

Here's the minial reproduction repo: https://github.com/bismuth1991/effect-workflow-repro

Thanks,
Bao
Was this page helpful?