Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

fix: bytes field should be typed as a Buffer#1652

Merged
sofisl merged 5 commits intogoogleapis:mainfrom
alvarowolfx:fix-bytes-type-buffer
Feb 5, 2025
Merged

fix: bytes field should be typed as a Buffer#1652
sofisl merged 5 commits intogoogleapis:mainfrom
alvarowolfx:fix-bytes-type-buffer

Conversation

@alvarowolfx
Copy link
Contributor

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 a review from a team as a code owner September 6, 2024 17:11
@alvarowolfx alvarowolfx requested a review from a team 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.

@sofisl sofisl requested a review from a team as a code owner February 5, 2025 01:06
@sofisl sofisl merged commit a81663f into googleapis:main Feb 5, 2025
23 checks passed
@release-please release-please bot mentioned this pull request Feb 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants