You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(fusion-ts): ComputedState.value rethrows stored error instead of masking it (S2)
ComputedState overrode `value` and `valueOrUndefined` to fall back to the
last non-error computed on an error output, diverging from the base State
class (and C# State.Value) and producing a contradictory state where
`hasValue` is false while `value` returns a value. Callers of a state whose
computer starts failing kept receiving the last good value with no signal
anything was wrong.
Remove both overrides so `value` / `valueOrUndefined` / `output` inherit the
base-class (C# State.Value / ValueOrDefault) semantics: `value` rethrows the
stored error, `valueOrUndefined` returns undefined on error, `output` reflects
the error result. Stale-value access stays available only through the explicit
`lastNonErrorValue` getter (C# State.Value vs LastNonErrorValue split).
The useComputedState hook already reads `valueOrUndefined` and exposes `error`
separately, so its documented `{ value, error }` shape is unchanged and now
matches useMutableState: `value` is undefined on error.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDiBQM5rnhyBG1asuP1kDi
Copy file name to clipboardExpand all lines: docs/plans/ts-port-audit.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,8 @@ Confidence: confirmed.
270
270
271
271
### S2. `ComputedState.value` silently masks errors by falling back to `lastNonErrorValue`
272
272
273
+
Status: **closed** — fixed 2026-07-15 (batch s2fix — the one item the campaign's batching initially missed): `value`/`valueOrUndefined`/`output` inherit the base-class behavior (throw / undefined / error result); stale access only via the explicit `lastNonErrorValue` (C# `Value` vs `ValueOrDefault` vs `LastNonErrorValue` parity). The React hook was already reading `valueOrUndefined`, so its `value` is now `undefined` on error, matching its documented shape.
274
+
273
275
Confidence: confirmed.
274
276
275
277
- TS: `computed-state.ts:72-79` — when `_computed.hasError`, `value` returns `_lastNonErrorValue` instead of throwing; `valueOrUndefined` (`computed-state.ts:86-89`) likewise. Base `State.value` and `MutableState`*do* throw on error (`state.ts:33-35`) — the port is internally inconsistent too.
0 commit comments