Conversation
|
044bb99 to
16cac5e
Compare
size-limit report 📦
|
There was a problem hiding this comment.
Generally makes sense to me, I would like @lukasIO to give the final ✅ since he originally wrote this code and is more familiar with the edge cases in data streams than I am.
You should be able to fix the ci error by running pnpm format locally and committing the results.
Also, if you could add a changeset that would be appreciated!
lukasIO
left a comment
There was a problem hiding this comment.
Agree with @1egoman 's comment about the numberToBigInt simplification. This util function has been written exactly for these use cases and to allow undefined values to pass through as undefined. If it doesn't work, then that's a bug in the function.
You're totally right that the protocol says that this is unset only for non-finite streams.
I think we'll be on the safer side if we interpret 0 length as non-finite additionally. I'm not sure I can think about a use case with a 0 size length.
Addresses an issue where the stream header specifies zero instead of undefined for non-finite streams, causing remote clients that validate stream length to be unable to read the stream. According to the doc comment for the
totalLengthfield in the Protobuf definition, it is “only populated for finite streams, if it's a stream of unknown size this stays empty.”