effect-cf 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # effect-cf
2
2
 
3
+ ## 0.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#80](https://github.com/danieljvdm/effect-cf/pull/80) [`cd83c7c`](https://github.com/danieljvdm/effect-cf/commit/cd83c7cc86bb8edfcd1449c17cca1c26aecc8a06) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Stop failing workflow status reads with `WorkflowResultDecodeError` when Cloudflare reports `output: null` for a non-complete instance. The wrapped `WorkflowInstance.status` now returns the real status (e.g. `errored`) with `Option.none()` output and the preserved `error`, while a completed workflow with a `Schema.Null` result still decodes `null` as `Option.some(null)`.
8
+
3
9
  ## 0.23.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.mjs CHANGED
@@ -3745,7 +3745,7 @@ const makeClient = (definition) => {
3745
3745
  terminate: operation("terminate", () => raw.terminate()),
3746
3746
  restart: (options) => operation("restart", () => raw.restart(options)),
3747
3747
  status: operation("status", () => raw.status()).pipe(Effect.flatMap((status) => Effect.gen(function* () {
3748
- const output = status.output === void 0 ? Option.none() : Option.some(yield* decodeResult(status.output).pipe(Effect.mapError((cause) => new WorkflowResultDecodeError({
3748
+ const output = status.output === void 0 || status.output === null && status.status !== "complete" ? Option.none() : Option.some(yield* decodeResult(status.output).pipe(Effect.mapError((cause) => new WorkflowResultDecodeError({
3749
3749
  binding: definition.binding,
3750
3750
  instanceId: raw.id,
3751
3751
  cause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-cf",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "Effect-native primitives for Cloudflare Workers and bindings.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -177,8 +177,12 @@ export const makeClient = <
177
177
  status: operation("status", () => raw.status()).pipe(
178
178
  Effect.flatMap((status) =>
179
179
  Effect.gen(function* () {
180
+ // Cloudflare reports `output: null` as a no-output sentinel while an
181
+ // instance is not complete; only a complete instance may carry a real
182
+ // null result (e.g. Schema.Null).
180
183
  const output =
181
- status.output === undefined
184
+ status.output === undefined ||
185
+ (status.output === null && status.status !== "complete")
182
186
  ? Option.none<ResultValue>()
183
187
  : Option.some(
184
188
  yield* decodeResult(status.output).pipe(