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
I'm experiencing an issue with Vue Query's persist plugin where the deserialize method is not always being called as expected. This is causing inconsistent behavior in my components, as sometimes the data passed to the select function is serialized, even though it should always be the return type of queryFn, which in my case is a Model class instance.
I've confirmed that the deserialize method in my LocalStorageQuerySerializer class is correctly implemented and should return a CiDetails instance. However, the debugger statement inside the select function is sometimes hit, indicating that the data is serialized, and in these cases, the debugger statement inside LocalStorageQuerySerializer.deserialize is not hit:
I did notice that in these cases, deserialize is called immediately after the first select call, which hits the debugger statement inside deserialize, and then select is called again with correctly deserialized data.
I would expect the deserialize method to always be called before the select function, ensuring that the data is always deserialized. Is there something I'm missing, or is this a potential bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm experiencing an issue with Vue Query's persist plugin where the
deserialize
method is not always being called as expected. This is causing inconsistent behavior in my components, as sometimes the data passed to theselect
function is serialized, even though it should always be the return type ofqueryFn
, which in my case is a Model class instance.Here's the relevant part of my code:
I've confirmed that the deserialize method in my
LocalStorageQuerySerializer
class is correctly implemented and should return aCiDetails
instance. However, the debugger statement inside the select function is sometimes hit, indicating that the data is serialized, and in these cases, the debugger statement insideLocalStorageQuerySerializer.deserialize
is not hit:I did notice that in these cases,
deserialize
is called immediately after the firstselect
call, which hits the debugger statement insidedeserialize
, and thenselect
is called again with correctly deserialized data.I would expect the deserialize method to always be called before the select function, ensuring that the data is always deserialized. Is there something I'm missing, or is this a potential bug?
Any help would be greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions