Why a Second Proxy Around Vue's reactive Array Silently Breaks View Updates
Layering a custom Proxy over a Vue reactive object silently disables dependency tracking unless the Proxy handles `__v_raw` specially; developers who wrap reactive data for caching, logging, or decoration will hit a 'data changes but UI doesn't' bug that looks like a rendering issue, not a Proxy trap problem.
Wrapping a Vue reactive array in your own Proxy can put data into the array while the view stays frozen. In the minimal repro, `raw` holds the new item, but `len` and the `v-for` loop don't update. The write succeeds because it lands on `raw`; only the dependency notification is lost.
The loss happens in the inner `reactiveArr` set trap. It checks `target === toRaw(receiver)`, where `receiver` is the outer Proxy. `toRaw` follows `__v_raw`, but the outer Proxy's get trap treats `__v_raw` like any other object property: it gets `raw`, sees an object, and wraps it again with `wrap(raw)`. So `toRaw(proxyC)` returns `wrap(raw)` instead of `raw`, the equality check fails, and `trigger` never runs.
The fix is to special-case `__v_raw` in the outer get trap and return `t` directly. That lets `toRaw` peel through the chain back to `raw`, restoring the equality check and the trigger. Any Proxy wrapping Vue reactive objects must honor this internal contract or silently kill reactivity.
Vue's `__v_raw` contract is a single point of failure: any wrapper that doesn't honor it can silently break reactivity while the write still succeeds.
Because the write lands in `raw`, the symptom is a view lagging behind the data, a pattern easy to mistake for a caching or timing issue rather than a Proxy trap flaw.