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] Headers already sent error when user data download is disabled #23805

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

sampaiodiego
Copy link
Member

Proposed changes (including videos or screenshots)

When using the export message tool when trying to download the file using the link sent via email if the feature "Export User Data" is disabled an error was being thrown causing the request to halt.

This is the error shown in the logs:

=== UnHandledPromiseRejection ===
Error [ERR_HTTP_HEADERS_SENT] [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:530:11)
    at ServerResponse.res.setHeader (/app/bundle/programs/server/npm/node_modules/meteor/simple_json-routes/node_modules/connect/lib/patch.js:134:22)
    at app/user-data-download/server/exportDownload.js:14:7
    at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 {
  code: 'ERR_HTTP_HEADERS_SENT'
}
---------------------------------
Errors like this can cause oplog processing errors.
Setting EXIT_UNHANDLEDPROMISEREJECTION will cause the process to exit allowing your service to automatically restart the process
Future node.js versions will automatically exit the process
=================================

Issue(s)

Steps to test or reproduce

Further comments

@sampaiodiego sampaiodiego requested a review from a team November 26, 2021 22:25
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

@sampaiodiego sampaiodiego requested a review from a team December 20, 2021 12:13
@ggazzo ggazzo merged commit a2c9396 into develop Dec 20, 2021
@ggazzo ggazzo deleted the fix-hanging-export-file-request-when-disabled branch December 20, 2021 13:14
@sampaiodiego sampaiodiego mentioned this pull request Dec 29, 2021
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.

3 participants