-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Result of retrocycle lost when using custom reviver #24
Comments
I'm also curious if it's intended that when using a reviver that you won't get any of the retrocycle processing? We're using https://github.com/zalmoxisus/remotedev-serialize and it's not able to handle |
Thanks for the bug report. A fix is out in |
@kolodny Looks like the issue still persists in Here's an example: jsan.parse('{"2":{"type":"PERFORM_ACTION","action":{"type":{"$jsan":"sINCREMENT"}},"timestamp":1543156067688},"3":{"type":"PERFORM_ACTION","action":{"type":{"$jsan":"sINCREMENT"}},"timestamp":1543156067839}}', (key, value)=>value) It returns: { '2': { type: 'PERFORM_ACTION', action: {}, timestamp: 1543156067688 },
'3': { type: 'PERFORM_ACTION', action: {}, timestamp: 1543156067839 } } While without the reviver: { '2':
{ type: 'PERFORM_ACTION',
action: { type: Symbol(INCREMENT) },
timestamp: 1543156067688 },
'3':
{ type: 'PERFORM_ACTION',
action: { type: Symbol(INCREMENT) },
timestamp: 1543156067839 } } |
I confirm that the issue is still open. We are using redux-devtools, which recently reverted it's jsan depedency to 3.1.9. That broke serialization of our actions and forced us to disable redux-devtools since it was preventing the app from running (in dev mode). Serialization of the same objects works in 3.1.10 & 3.1.11 Thank you very much for the time and effort spend on looking into this issue! :) |
Understood, thank you for looking into it! Unfortunately we do not presently have the resources needed to research the issue further and contribute the necessary fix. If it helps, we are using: @angular 5.2.11 The action that is causing the issue is 3-rd party to us. It is the "ROUTER_NAVIGATION" action from @ngrx Thanks, :) |
I published However by not recording refs, we are not handling circular references as well, so there will be an infinite recursion in that case. I suggested a fix in #27. |
Moved @jsmonkey's tests to zalmoxisus/remotedev-serialize@7f33612 and looks like it works now as expected. It was better to have them here as it was made, but |
Related to #540 and kolodny/jsan/issues/24
This change ca645a9 seems to cancel the effect of
retrocycle
when using customreviver
, since resolved value is strigified, than parsed again.For example if I want to let $jsan deal with
Date
values inretrocycle
and additionally use customreviver
for some custom type,Date
value will be stringifed once resolved and then parsed into string, so I end up withstring
instead ofDate
.Is the idea of this change that you should either not use
reviver
at all, or to usereviver
for all the values, including the onesretrocycle
can process?P.S. This line is useless after this change since
needsRetrocycle
variable is never used.The text was updated successfully, but these errors were encountered: