Skip to content

task complete#214

Open
NikolayDek wants to merge 6 commits intomate-academy:masterfrom
NikolayDek:develop
Open

task complete#214
NikolayDek wants to merge 6 commits intomate-academy:masterfrom
NikolayDek:develop

Conversation

@NikolayDek
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

Great job on implementing the server with streams and handling most of the requirements! However, a couple of critical fixes are needed before this can be approved.

  • Invalid HTML: In src/public/index.html, the <form> element is incorrectly closed with a </div> tag. It should be </form> to ensure the form is structured correctly and functions as expected.
  • Incorrect File Extensions: In createServer.js, the compressed file extensions do not match the task requirements. The server should produce .gz for gzip and .dfl for deflate. Please adjust your extensionMap to use the correct extensions.

Once these issues are addressed, your solution will be in great shape. Keep up the good work!


✨ 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

Submit
</button>
</div>
</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This closing </div> tag is incorrect. It appears it should be a closing </form> tag to properly close the <form> element that was opened on line 12.

Comment on lines +21 to +25
const extensionMap = {
gzip: 'gzip',
deflate: 'deflate',
br: 'br',
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to the task description, the file extensions for gzip and deflate should be .gz and .dfl, respectively. The current implementation uses .gzip and .deflate.

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.

Then why do the tests expect a filename that includes the full compression format?

● createServer › Server › POST to the "/compress" endpoint › compression type "gzip" › should respond with a correct "Content-Disposition" header

expect(received).toBe(expected) // Object.is equality

Expected: "attachment; filename=ick_that.tar.gzip"
Received: "attachment; filename=ick_that.tar.gz"

  127 |                   const expectedHeader = `attachment; filename=${filename}.${compressionType}`;
  128 |
> 129 |                   expect(res.headers['content-disposition']).toBe(
      |                                                              ^
  130 |                     expectedHeader,
  131 |                   );
  132 |                 });

  at toBe (tests/createServer.test.js:129:62)

● createServer › Server › POST to the "/compress" endpoint › compression type "deflate" › should respond with a correct "Content-Disposition" header

expect(received).toBe(expected) // Object.is equality

Expected: "attachment; filename=dehumanize.dump.deflate"
Received: "attachment; filename=dehumanize.dump.dfl"

  127 |                   const expectedHeader = `attachment; filename=${filename}.${compressionType}`;
  128 |
> 129 |                   expect(res.headers['content-disposition']).toBe(
      |                                                              ^
  130 |                     expectedHeader,
  131 |                   );
  132 |                 });

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

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

Excellent work fixing the HTML form issue from the last review! Your server logic is solid and meets almost all requirements. However, one critical issue remains, which requires a change. The server is generating incorrect file extensions for gzip and deflate compression. According to the task description, the extensions must be .gz and .dfl. Your extensionMap in src/createServer.js currently uses .gzip and .deflate. Please update this constant with the correct values. You are very close to completing this!


✨ 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 on lines +21 to +25
const extensionMap = {
gzip: 'gzip',
deflate: 'deflate',
br: 'br',
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The extensions for gzip and deflate are not quite right. According to the task description, they should be .gz and .dfl respectively. Please update this map to use the correct extensions.

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

Excellent work on this submission! You've correctly implemented the file extensions (.gz, .dfl) exactly as the task description requested. Unfortunately, there's a mismatch between the description and the automated tests, which is causing the build to fail as the tests expect the full compression names as extensions (.gzip, .deflate). To fix this, you can modify src/createServer.js to use the compression variable directly for the extension in the Content-Disposition header. Because you followed the written instructions perfectly, I am approving this submission as an educational override to help you move forward. Make this small change to get your tests passing. Keep up the great 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