File tree Expand file tree Collapse file tree
packages/endpoint/src/schemas Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,18 @@ export default class Scalar implements Mergeable {
156156 }
157157
158158 denormalize ( input : any , delegate : IDenormalizeDelegate ) : any {
159+ // Deliberately broad falsy guard — not just `null`/`undefined`. In normal
160+ // flow `input` is a wrapper tuple (array), a cpk string, a cell object, or
161+ // a symbol (INVALID propagation). A primitive non-string like `0`/`false`
162+ // can only appear from a malformed store or a direct unit-test call; if
163+ // one reached the Values branch below it would infinite-recurse via
164+ // `delegate.unvisit(this, 0) → unvisit → schema.denormalize(0, …)` since
165+ // `isEntity(this)` is false and the string-input fast path doesn't match.
166+ // Returning it verbatim is the safe terminal case. Memoization stays
167+ // coherent because `input` comes from the stored entity row, so any shape
168+ // change implies a new entity reference and a full re-traversal — the
169+ // cached `argsKey`-bearing chain is never replayed against a frame that
170+ // skipped the guard.
159171 if ( ! input || typeof input === 'symbol' ) return input ;
160172
161173 // Entity-field wrapper: `[entityPk, fieldName, entityKey]` (see normalize).
You can’t perform that action at this time.
0 commit comments