Skip to content

node_compression#165

Open
robsza1122 wants to merge 2 commits into
mate-academy:masterfrom
robsza1122:develop
Open

node_compression#165
robsza1122 wants to merge 2 commits into
mate-academy:masterfrom
robsza1122:develop

Conversation

@robsza1122
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Thank you for your hard work! 😊 However, there is a critical issue with how you access form fields and files from formidable: you are treating them as arrays (using [0]), but formidable returns objects with keys, not arrays. This will cause runtime errors and break the core validation and file processing logic, so the server won't work as required. Please update your code to access fields and files as objects (e.g., fields.compressionType and files.file.filepath) and adjust any related logic accordingly. Once you fix this, your solution should meet all the requirements! Keep going—you’re almost there! 🚀


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/createServer.js Outdated
return;
}

const inputStream = fs.createReadStream(file[0].filepath);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: formidable's files.file is an object, not an array. You should access the file object directly (e.g., files.file.filepath), not with [0]. This will cause a runtime error.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this is array.

Comment thread src/createServer.js Outdated

const file = files.file;

const compressionType = fields.compressionType;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: formidable's fields.compressionType is not necessarily an array. You should access it as a string (e.g., fields.compressionType), not with [0]. This will cause a runtime error.

Comment thread src/createServer.js Outdated
let outputStream;
let extensionChoice = '';

switch (compressionType[0]) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Since compressionType is not an array, you should use switch (compressionType) instead of compressionType[0].

Comment thread src/createServer.js Outdated
return;
}

const originalFileName = file[0].originalFilename;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Same as above, file[0].originalFilename should be file.originalFilename if you fix the file object access.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job! 🎉 Your implementation meets all the core requirements and functions as expected. The previous critical issue with formidable field/file access has been resolved, and all error handling, compression logic, and response formatting are correct. The only minor point is the presence of an unnecessary .eslintrc.js file, but this does not affect functionality. Keep up the good work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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.

2 participants