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(hash-stream-node): disable createReadStream with file descriptor #3369

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/hash-stream-node/src/fsCreateReadStream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jest.setTimeout(30000);
describe(fsCreateReadStream.name, () => {
const mockFileContents = fs.readFileSync(__filename, "utf8");

it("uses file descriptor if defined", (done) => {
it.skip("uses file descriptor if defined", (done) => {
fs.promises.open(__filename, "r").then((fd) => {
if ((fd as any).createReadStream) {
const readStream = (fd as any).createReadStream();
Expand Down
3 changes: 2 additions & 1 deletion packages/hash-stream-node/src/fsCreateReadStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { createReadStream, ReadStream } from "fs";

export const fsCreateReadStream = (readStream: ReadStream) =>
createReadStream(readStream.path, {
fd: (readStream as any).fd,
// ToDo: Removed to fix https://github.com/aws/aws-sdk-js-v3/issues/3368
// fd: (readStream as any).fd,
start: (readStream as any).start,
end: (readStream as any).end,
});