Closed davidtwin closed 5 months ago
Thanks @davidtwin for submitting this issue, I'll make a reproduction and see why this is an issue.
Yeah this seems to be the offending code in inertia-sails
Hey @davidtwin, I've solved this issue and the changes will be a 0.2.0 release of inertia-sails
.
Hey @davidtwin here is the guide for when you want to upgrade, let me know if this fixes the issue for you too.
Closing this issue as this has been resolved by #86 and #87
Description
When there are more than 2 users logged in and are making a request to server at the same time, I get an error
error: Sending 500 ("Server Error") response: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at new NodeError (node:internal/errors:405:5) at ServerResponse.setHeader (node:_http_outgoing:652:11) at ServerResponse.header (/Users/DavidMendesDaSilva/Sites/h2pro-webapp/node_modules/express/lib/response.js:776:10) at ServerResponse.send (/Users/DavidMendesDaSilva/Sites/h2pro-webapp/node_modules/express/lib/response.js:170:12) at ServerResponse.json (/Users/DavidMendesDaSilva/Sites/h2pro-webapp/node_modules/express/lib/response.js:267:15) at hook.render (/Users/DavidMendesDaSilva/Sites/h2pro-webapp/node_modules/inertia-sails/private/inertia-middleware.js:52:20) at Object.fn (/Users/DavidMendesDaSilva/Sites/h2pro-webapp/api/controllers/order/view-orders.js:168:26) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ...
Current behavior
only one user request is getting completed and the other one normally gets the error and crashes. ...
Expected behavior
Both users should be able to make requests at the same time ...
[x] I have checked and this issue does not exist