Skip to content
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

when serialize/deserialize BooleanObject, the extra info losted #48137

Closed
navegador5 opened this issue May 23, 2023 · 3 comments
Closed

when serialize/deserialize BooleanObject, the extra info losted #48137

navegador5 opened this issue May 23, 2023 · 3 comments
Labels
v8 module Issues and PRs related to the "v8" subsystem.

Comments

@navegador5
Copy link

navegador5 commented May 23, 2023

Version

Node.js v20.1.0.

Platform

Linux dev 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

deps/v8/src/objects/value-serializer.cc WriteJSPrimitiveWrapper

What steps will reproduce the bug?

var fo = new Boolean(false)
undefined
fo["#reason"] = "no-reponse-from-remote"
'no-reponse-from-remote'
fo
[Boolean: false] { '#reason': 'no-reponse-from-remote' }

v8.serialize(fo)
<Buffer ff 0d 78>

v8.deserialize(v8.serialize(fo))
[Boolean: false]

var not_my_false = v8.deserialize(v8.serialize(fo))
undefined
not_my_false["#reason"]


var also_not_my_false = structuredClone(fo)

also_not_my_false
[Boolean: false]

also_not_my_false["#reason"]

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

Although PrimitiveWrapObject Is rarely used, But I think it should keep the extra info when serialized.

our Application use this Boolean(false) to carry "reason-info", and serialized it to a log-server.

What do you see instead?

extra info losted when deser(ser)

Additional information

No response

@MoLow
Copy link
Member

MoLow commented May 23, 2023

I think this issue should be reported at the v8 project

@MoLow MoLow added the v8 module Issues and PRs related to the "v8" subsystem. label May 23, 2023
@MoLow
Copy link
Member

MoLow commented May 23, 2023

we call v8 WriteValue directly.
I recommend opening a feature request here: https://bugs.chromium.org/p/v8/issues/list?q=ValueSerializer&can=1

@MoLow MoLow closed this as completed May 23, 2023
@navegador5
Copy link
Author

got it. thinks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 module Issues and PRs related to the "v8" subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants