Skip to content

[MON-146045] Prevent Hapi response races during webpack rebuilds - #16

Open
iu-glints wants to merge 1 commit into
glints-dev:masterfrom
iu-glints:feature/mon-146045
Open

iu-glints wants to merge 1 commit into
glints-dev:masterfrom
iu-glints:feature/mon-146045

Conversation

@iu-glints

Copy link
Copy Markdown
  • Fix ERR_HTTP_HEADERS_SENT when an asset request arrives during recompilation. webpack-dev-middleware can fulfill its promise after queueing the request, before writing the response. The previous adapter then let Hapi send a response first.
  • Wait for middleware next() or response finish/close. Remove listeners on settlement and handle synchronous throws, rejected promises, callback errors, and response errors.
  • Use the same adapter for hot middleware so disconnected event streams release the pending Hapi lifecycle.
  • Add real Hapi/Webpack regression coverage for bulk file edits and concurrent asset requests, plus lifecycle/error cases. Run the suite in CI against development middleware 6.1.1.
Asset arrives during rebuild
  Webpack queues the request
  Hapi waits
  Webpack serves the rebuilt asset
  Adapter returns h.abandon

Task: MON-146045

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.

1 participant