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: bytes field should be typed as a Buffer #1652

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alvarowolfx
Copy link

protobufjs uses the $util.newBuffer function to decode and initialize bytes protobuf fields. This makes so that most of times I see those fields coming as Buffers, not Uint8Array or string. This was already observed by other users as you can see here and here.

This PR adds the Buffer type to the Typescript definition to take that into account.

Related issues/references:

Towards googleapis/nodejs-bigquery-storage#335 and internal b/277340507
Supersedes googleapis/nodejs-bigquery-storage#336

@alvarowolfx alvarowolfx requested review from a team as code owners September 6, 2024 17:11
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Sep 6, 2024
@alvarowolfx alvarowolfx requested a review from sofisl September 6, 2024 17:18
@alvarowolfx alvarowolfx added the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 6, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 6, 2024
@sofisl
Copy link
Contributor

sofisl commented Sep 9, 2024

This looks good to me, but ideally we'd run this test (or something like it) to confirm our downstream repos won't break with this change. If you have time @alvarowolfx, it would be awesome if we could run this test as part of changes to compileProtos! I'd be happy to pair with you if you want to add this test. Otherwise we can always just release an experimental version of gapic-tools and install it locally to confirm it doesn't break anything downstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants