-
Notifications
You must be signed in to change notification settings - Fork 311
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 webBlob test (use LFS file as example instead of Xet file) #1230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coyotte508 it's normal this test is that long?
I genuinely haven't changed the test (only added the timeout) but now
|
Looking at
accept-ranges being changed. So we are now fetching the full file which is 4.8GB (hence the timeout) and returning a Blob instead of a WebBlob
=> certainly better to fix the root cause here rather than setting higher timeout 😞 |
I went down the rabbit hole and it is because content length is 1377 (instead of 4.8GB for linked size) so WebBlob downloads it fully. This was already the case for LFS files (so I don't know why it was working before) but now this is a Xet file (see CAS location). Can it be related to the xet migration?
|
Keep in mind that in the browser it's supposed to automatically follow redirects (or in node, when not specifying Maybe xet http bridge doesn't support content ranges, but that would be surprising Edit:
No accept-range header in head response but it's actually supported |
Yep, I arrived to the same conclusion thanks! So I've updated the test to use a file not served by Xet. That should fix the CI for now. I'll report on slack about Xet files not returning "accept-ranges: bytes" (I just checked and it does support it, just the header is not set). |
packages/hub/src/utils/WebBlob.ts
Outdated
@@ -21,7 +21,7 @@ export class WebBlob extends Blob { | |||
const customFetch = opts?.fetch ?? fetch; | |||
const response = await customFetch(url, { method: "HEAD" }); | |||
|
|||
const size = Number(response.headers.get("content-length")); | |||
const size = Number(response.headers.get("x-linked-size") ?? response.headers.get("content-length")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed 😬 done in 922bfdf
(linking slack thread - private link) |
CI currently fails with:
PR expectation: CI is green.
See #1230 (comment) and #1230 (comment) for explanation.