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

fix null versionstamp #86

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

codehz
Copy link
Contributor

@codehz codehz commented Jul 27, 2024

fix #85
use undefined is fine here, the generated type is wrong (the encodeBinary function actually compare the value with undefined)

? emptyVersionstamp
/* in proto3 all fields are optional, but the generated types don't
* like it, so we have to cast it manually */
? undefined as unknown as Uint8Array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just use new Uint8Array() here - the zero value is not distinguishable from an unset value in protobuf.

Copy link
Contributor Author

@codehz codehz Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it will work, it will be encoded and take up some bandwidth (I actually measure it output). undefined is only way to make it same as deno version

@losfair losfair merged commit 7d47a7e into denoland:main Aug 1, 2024
15 checks passed
@codehz codehz deleted the fix-atomic-write-check-null branch August 29, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

null versionstamp checks always failed (nodejs)
2 participants