### Version v22.5.0 ### Platform ```text Linux penguin 6.6.32-02873-ge0e03a627715 #1 SMP PREEMPT Mon, 1 Jul 2024 20:29:42 +0000 aarch64 GNU/Linux ``` ### Subsystem _No response_ ### What steps will reproduce the bug? ```js > await fs.promises.writeFile('a.txt', 'abcdefghij') > blob = await fs.openAsBlob('a.txt') Blob { size: 10, type: '' } > await _.text() 'abcdefghij' > blob.slice(3) Blob { size: 7, type: '' } > await _.text() 'defghij' > blob.slice(3).slice() Blob { size: 7, type: '' } > await _.text() 'defg' ``` ### How often does it reproduce? Is there a required condition? _No response_ ### What is the expected behavior? Why is that the expected behavior? `slice()` with no arguments should be equivalent to `slice(0, length)` and return the entire blob; both of those are incorrectly returning something else. ### What do you see instead? The returned `Blob` object purports to have the expected `size`, but when it is read it has the wrong length. ### Additional information _No response_
Activity
avivkeller commentedon Jul 17, 2024
Reproducible:
avivkeller commentedon Jul 17, 2024
It however does not occur with non-fs blobs:
HardikGoyal2003 commentedon Jul 17, 2024
Hey @redyetidev, could you assign me this issue? I'd like to work on it, if that's alright.
avivkeller commentedon Jul 17, 2024
Feel free to work on it, but issues aren't typically assigned (except when they are self assigned).
If you have an improvement, feel free to submit a PR.
jleedev commentedon Jul 20, 2024
node/src/dataqueue/queue.cc
Line 854 in cf8e535
Should be:
avivkeller commentedon Jul 20, 2024
Feel free to submit a PR with suggestions to the Conway.
src: fix slice of slice of file-backed Blob
src: fix slice of slice of file-backed Blob
src: fix slice of slice of file-backed Blob
src: fix slice of slice of file-backed Blob