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: oneof type only write/size once #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hchenn
Copy link
Contributor

@Hchenn Hchenn commented Jan 10, 2025

What type of PR is this?

What this PR does / why we need it (en: English/zh: Chinese):

en:
zh: pb marshal 默认对于空值是不写入编码的,但是 union 类型存在特例:如果声明了 union 的具体类型默认值,必须要写入这个类型,对端 receive 才能得知 "one of which type"
当前的 fastwrite 没有考虑到这点,直接跳过了带空值的 union 类型,导致接收端无法得知具体是哪个类型

Which issue(s) this PR fixes:

@Hchenn Hchenn requested review from a team as code owners January 10, 2025 16:35
@xiaost
Copy link

xiaost commented Jan 13, 2025

actually, I don't know what this change fixed, and it doesn't come with unittest as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants