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
The changes introduced by #7733 can lead to identity hazards in dev mode, when shallow option is set to false.
Since the state is now shallowReactive, only the root level object is proxied. Using readonly makes nested objects proxied as well.
Nested objects are proxied in dev mode when shallow option is set to false, but not proxied in prod mode.
I expect dev and prod to behave the same.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
OS: macOS
Browser: Chrome
Version: 128.0.6613.120
Tanstack Query adapter
vue-query
TanStack Query version
v5.56.2
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
JoaoPedroAS51
changed the title
Using readonly with shallowReactive in dev mode can lead to identity hazards
[vue-query] shallow: false can lead to identity hazards
Sep 13, 2024
Describe the bug
Hi!
The changes introduced by #7733 can lead to identity hazards in dev mode, when
shallow
option is set tofalse
.Since the
state
is nowshallowReactive
, only the root level object is proxied. Usingreadonly
makes nested objects proxied as well.Your minimal, reproducible example
https://play.vuejs.org/#eNp9Us1OwkAQfpXJXpCEUBFPTUuihoMe1IA3lsPaTqHY7m52t4ipfXd3WwrFkF6aznw/881kS/Ig5XhfIPFJoCOVSgMaTSFnlKe5FMpACXrLskx8L5BFJt3jCBSyWPDsZ9SBjg0jFphoqCBRIoeBdR5QTnkkuLbOhhmE8L/hTQkxM8yHVQmJED4MPpkaQLWGangWtyT3ndgB4XHWTe06BM8DqUQM1/h3F/zLzEd9bRDjHn7beD4YVeBVv2nXr71Gj1HCMo2UB15zYntcWxjMZWYVtgIIpMLZsuFDG82Hspk6Wd2uIQzDZhlXQFUFntOcxP2iqSvOmsDrTCcjYrRdMkk3450W3L6F0tlSEolcphmqN2lSewRKrLlDHFZHfal77k6jth9tMfq60t/pg+tR8q5Qo9ojJSfMMLVB08Dz5Sse7P8JzEVcZJbdAy5Qi6xwGRvaY8FjG7vDq9M+1y865ZsPPT8Y5LpdygV1zKrmU2Kf7VPP6ue40/F9raO8ItUfwoMcyA==
Steps to reproduce
Check the comparison in the playground
Expected behavior
Nested objects are proxied in dev mode when
shallow
option is set tofalse
, but not proxied in prod mode.I expect dev and prod to behave the same.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
Tanstack Query adapter
vue-query
TanStack Query version
v5.56.2
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: