Skip to content

solution#201

Open
snezhana-recruit wants to merge 4 commits intomate-academy:masterfrom
snezhana-recruit:develop
Open

solution#201
snezhana-recruit wants to merge 4 commits intomate-academy:masterfrom
snezhana-recruit:develop

Conversation

@snezhana-recruit
Copy link

No description provided.

Copy link

@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 work on this submission! The server correctly handles routing, error conditions, and the file compression process using streams. However, one change is needed to meet all requirements. The compressed files are being created with incorrect extensions. The task requires .gz for gzip and .dfl for deflate, but your implementation currently uses .gzip and .deflate. Please adjust the logic that sets the Content-Disposition header to map the compression type to the correct file extension. After you fix that, it will be ready for approval!


✨ 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


res.setHeader(
'Content-Disposition',
`attachment; filename=${fileInfo.filename}.${compressionType}`,

Choose a reason for hiding this comment

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

The task requires the file extensions to be .gz for gzip and .dfl for deflate. This implementation uses the compressionType variable directly, which results in .gzip and .deflate. You'll need to add some logic to map the compression type to the correct file extension.

Copy link
Author

Choose a reason for hiding this comment

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

but your comment conflicts with tests

@snezhana-recruit
Copy link
Author

@mateacademy-ai-mentor your comment conflicts with tests

Copy link

@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

Hello! Thanks for the update. Your server implementation is looking solid, and you've done a great job with the routing and stream handling. However, changes are needed because the issue with the file extensions mentioned in the previous review still persists. The server is generating files with .gzip and .deflate extensions instead of the required .gz and .dfl. To fix this, you'll need to map the compressionType from the form to the correct file extension. For instance, when the compressionType is gzip, the extension should be gz. An object or a switch statement would be a good way to handle this mapping before you construct the filename in the Content-Disposition header. Addressing this will get your solution across the finish line!


✨ 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


res.setHeader(
'Content-Disposition',
`attachment; filename=${fileInfo.filename}.${compressionType}`,

Choose a reason for hiding this comment

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

The file extension for gzip and deflate compression is still incorrect. The requirements specify that gzip should use the .gz extension and deflate should use .dfl. Currently, you are appending the full compressionType value, which results in .gzip and .deflate.

You'll need to map the compressionType to its corresponding required extension.

Copy link

@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

Excellent work on this iteration! I'm happy to approve your solution. You've successfully addressed all the feedback from the previous review, especially regarding the file extensions. Using an object to map compression types to their extensions was a great, clean approach. Your server implementation is robust, correctly handling streams, routing, and error conditions as required. The code is well-structured and fully meets all project requirements. Keep up the fantastic 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