Skip to content

Commit

Permalink
Add destroy request call in close event to support SSE closing (#34)
Browse files Browse the repository at this point in the history
### Developer Checklist (Definition of Done)

**Issue**

- [x] All acceptance criteria from the issue are met
- [x] Tested in latest Chrome/Firefox

**UI/UX/Vis**

- [ ] Requires UI/UX/Vis review
  - [ ] Reviewer(s) are notified (_tag assignees_)
  - [ ] Review has occurred (_link to notes_)
  - [ ] Feedback is included in this PR
  - [ ] Reviewer(s) approve of concept and design

**Code**

- [x] Branch is up-to-date with the branch to be merged with, i.e.,
develop
- [x] Code is cleaned up and formatted
- [x] Unit tests are written (frontend/backend if applicable)
- [x] Integration tests are written (if applicable)

**PR**

- [x] Descriptive title for this pull request is provided (will be used
for release notes later)
- [x] Reviewer and assignees are defined
- [x] Add type label (e.g., *bug*, *feature*) to this pull request
- [x] Add release label (e.g., `release: minor`) to this PR following
[semver](https://semver.org/)
- [x] The PR is connected to the corresponding issue (via `Closes #...`)
- [x] [Summary of changes](#summary-of-changes) is written


### Summary of changes

- Destroy the current request on close to properly close any open SSE
(server side events) sessions. Otherwise, the sessions will remain open
and never be closed, causing issues with the reload process hanging
infinitely.

### Screenshots


### Additional notes for the reviewer(s)

-  
Thanks for creating this pull request 🤗
  • Loading branch information
puehringer authored Jun 23, 2023
2 parents 4ec289e + 658115f commit 8cacf5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ module.exports = (webpackEnv, argv) => {
target: 'http://localhost:9000',
secure: false,
ws: true,
// Explicitly forward close events for properly closing SSE (server-side events). See https://github.com/webpack/webpack-dev-server/issues/2769#issuecomment-1517290190
onProxyReq: (proxyReq, req, res) => {
res.on('close', () => proxyReq.destroy());
},
},
'/login': {
target: 'http://localhost:9000',
Expand Down

0 comments on commit 8cacf5e

Please sign in to comment.