n8n icon indicating copy to clipboard operation
n8n copied to clipboard

fix(core): Webhooks responding with binary data should not prematurely end the response stream

Open netroy opened this issue 3 months ago • 4 comments

Summary

Whenever piping a stream into response, there is always a chance that await pipeline(stream, res) (or stream.pipe(res)) closes the response stream before we are done with the stream object. To avoid this issue, any stream being piped into response should use the option end: false, and then explicitly close the response stream after responseCallback has been called.

Related tickets and issues

PAY-1326 PAY-1465 https://github.com/n8n-io/n8n/issues/9291

Review / Merge checklist

  • [x] PR title and summary are descriptive
  • [ ] Tests included

netroy avatar Apr 04 '24 18:04 netroy

:warning: Some Cypress E2E specs are failing, please fix them before merging

github-actions[bot] avatar May 03 '24 09:05 github-actions[bot]

2 failed and 1 flaky tests on run #4860 ↗︎

2 290 5 0 Flakiness 1

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project: n8n Commit: e02fef2237
Status: Failed Duration: 04:15 💡
Started: May 3, 2024 2:56 PM Ended: May 3, 2024 3:01 PM
Failed  16-webhook-node.cy.ts • 1 failed test

View Output Video

Test Artifacts
Webhook Trigger node > should listen for a GET request and respond with Respond to Webhook node Test Replay Screenshots Video
Failed  17-workflow-tags.cy.ts • 1 failed test

View Output Video

Test Artifacts
Workflow tags > should update a tag via modal Test Replay Screenshots Video
Failed  28-debug.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  28-resource-mapper.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  33-settings-personal.cy.ts • 0 failed tests

View Output

Test Artifacts

The first 5 failed specs are shown, see all 26 specs in Cypress Cloud.

Flakiness  cypress/e2e/17-sharing.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Sharing > should work for admin role on credentials created by others (also can share it with themselves) Test Replay Screenshots Video

Review all test suite changes for PR #9063 ↗︎

cypress[bot] avatar May 03 '24 09:05 cypress[bot]

:warning: Some Cypress E2E specs are failing, please fix them before merging

github-actions[bot] avatar May 03 '24 15:05 github-actions[bot]

:white_check_mark: All Cypress E2E specs passed

github-actions[bot] avatar May 06 '24 08:05 github-actions[bot]

Got released with [email protected]

janober avatar May 08 '24 12:05 janober