Was just testing my updates to add default timeouts to the RequestOptions
object and noticed something weird. Although the timeout fields are given default values:
#connectTimeout = defaultHttpTimeoutMs * nanoToMilliConversion;
#firstByteTimeout = defaultHttpTimeoutMs * nanoToMilliConversion;
#betweenBytesTimeout = defaultHttpTimeoutMs * nanoToMilliConversion;
If not explicitly set in the Guest they are still undefined. Adding the following console.log:
firstByteTimeoutMs() {
console.log("Value of #firstByteTimeout in firstByteTimeoutMs():", this.#firstByteTimeout)
return this.#firstByteTimeout / nanoToMilliConversion;
}
Outputs:
Value of #firstByteTimeout in firstByteTimeoutMs(): undefined
And ends up throwing the following error:
TypeError: invalid variant tag value `undefined` (received `TypeError: Cannot mix BigInt and other types, use explicit conversions`) specified for `ErrorCode`
Maybe I am missing something with how Resources are created in the host language that causes those fields to never be set? I did try moving setting the values into a constructor()
function, but got the same issue there.
Sorry I missed this, it was working in my initial implementation with the explicit undefined
tests, but I missed this branch when testing the updates to the PR.
CC: @Guy Bedford
I also just saw this - have already included a fix for this in https://github.com/bytecodealliance/jco/pull/408
Didn't get it in before you merged, but did have one question about that change: https://github.com/bytecodealliance/jco/pull/408#discussion_r1536012195
Last updated: Dec 23 2024 at 12:05 UTC