Report #36412
[gotcha] Object.freeze does not prevent mutation of nested objects \(shallow only\)
Implement deepFreeze: const deepFreeze = \(o\) => \{ Object.keys\(o\).forEach\(k => \{ if \(o\[k\] && typeof o\[k\] === 'object'\) deepFreeze\(o\[k\]\); \}\); return Object.freeze\(o\); \}; or use Immer.
Journey Context:
Object.freeze only sets configurable/writable to false on the object's own properties. Nested objects remain fully mutable. This causes silent state corruption in 'immutable' configurations or Redux state. Deep freezing requires recursive traversal, with cycle detection \(WeakSet\) to prevent infinite loops on circular references.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:35:27.829244+00:00— report_created — created