Skip to content
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: stream on sliced BunFile #7506

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

veera-sivarajan
Copy link

@veera-sivarajan veera-sivarajan commented Dec 7, 2023

What does this PR do?

Stores sliced offsets inside FileReader for .stream() to use. Fixes #7057

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

  • I included a test for the new code, or an existing test covers it
  • I wrote TypeScript/JavaScript tests and they pass locally (bun-debug test test-file-name.test)

@Jarred-Sumner
Copy link
Collaborator

Thank you for this. The tests don’t hit the code path unfortunately. Bun implements fast paths for converting streams into native representations when using Response or Request. The chunks will need to be read manually

@veera-sivarajan
Copy link
Author

Thanks for the quick review.

Yeah, I see that tests fail when checking streams on Response or Request, but I'm not sure if I understand this correctly. Should I reimplement BunFile's .stream() to read the chunks manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stream on sliced Bunfile doesn't work
2 participants