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!
| totalLength: info.size !== undefined | ||
| ? numberToBigInt(info.size) | ||
| : undefined, |
There was a problem hiding this comment.
nitpick: FYI that numberToBigInt actually is resilient to undefined, so something like the below could be a little simpler:
| totalLength: info.size !== undefined | |
| ? numberToBigInt(info.size) | |
| : undefined, | |
| totalLength: numberToBigInt(info.size), |
There was a problem hiding this comment.
My editor shows the typing as numberToBigInt<number>(value: number): bigint
There was a problem hiding this comment.
It might be because you have info.size in there - I bet if you removed it it would show the full un-narrowed generic value.
For reference, here is the actual function definition allowing both options:
client-sdk-js/src/room/utils.ts
Lines 685 to 689 in 3bea46a
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.”