Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Legends:

- 馃挜 `useSendMessage`: `init.attachments[].thumbnailURL` must be data URI, otherwise will be ignored, in PR [#5871](https://github.com/microsoft/BotFramework-WebChat/pull/5871), by [@compulim](https://github.com/compulim)
- 馃懛馃徎 Visual regression tests now use 5 consecutive screenshots for stability indication, up from 2, in PR [#5871](https://github.com/microsoft/BotFramework-WebChat/pull/5871), by [@compulim](https://github.com/compulim)
- 馃懛馃徎 Bumped `http-proxy-middleware` to 3.0.0, fixes [#5178](https://github.com/microsoft/BotFramework-WebChat/issues/5178), by [@Podugboch](https://github.com/Podugboch)

### Removed

Expand Down
6 changes: 1 addition & 5 deletions packages/test/harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
"3",
"global-agent@4 changed its signature, need time to migrate"
],
"http-proxy-middleware": [
"2",
"http-proxy-middleware@3 has breaking changes, need time to migrate"
],
"jest": [
"29",
"jest@30 is not supported by jest-image-snapshot@6.5.1"
Expand All @@ -61,7 +57,7 @@
"esbuild": "^0.28.0",
"express": "^5.2.1",
"global-agent": "^3.0.0",
"http-proxy-middleware": "^2.0.9",
"http-proxy-middleware": "^3.0.0",
"istanbul-lib-coverage": "^3.2.2",
"jest": "^29.7.0",
"jest-environment-node": "^29.7.0",
Expand Down
28 changes: 15 additions & 13 deletions packages/test/harness/src/host/jest-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,27 @@ async function prepareSession(sessionId) {
},
createProxyMiddleware({
...DEFAULT_PROXY_OPTIONS,
onProxyRes: responseInterceptor(async responseBuffer => {
const session = JSON.parse(responseBuffer.toString());
on: {
proxyRes: responseInterceptor(async responseBuffer => {
const session = JSON.parse(responseBuffer.toString());

const entry = { busy: true, numUsed: 1, session, sessionId: session.value.sessionId, startTime: Date.now() };
const entry = { busy: true, numUsed: 1, session, sessionId: session.value.sessionId, startTime: Date.now() };

pool.push(entry);
pool.push(entry);

setTimeout(() => housekeep(pool), INSTANCE_LIFE - INSTANCE_MIN_LIFE);
setTimeout(() => housekeep(pool), INSTANCE_LIFE - INSTANCE_MIN_LIFE);

await prepareSession(entry.sessionId);
await prepareSession(entry.sessionId);

console.log(
`New instance ${entry.sessionId} created. Now the pool has ${pool.length} instances: [${pool
.map(runLeft)
.join(', ')}].`
);
console.log(
`New instance ${entry.sessionId} created. Now the pool has ${pool.length} instances: [${pool
.map(runLeft)
.join(', ')}].`
);

return responseBuffer;
}),
return responseBuffer;
})
},
selfHandleResponse: true
})
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const proxy = require('http-proxy-middleware');
const { createProxyMiddleware } = require('http-proxy-middleware');

// Passthru-ing API traffic to /rest-api/
module.exports = app => {
app.use(proxy('/api', { target: 'http://localhost:5000/' }));
app.use(createProxyMiddleware('/api', { target: 'http://localhost:5000/' }));
};