Skip to content

Commit

Permalink
fix: remove unused code from the coordinator websocket impl (#1563)
Browse files Browse the repository at this point in the history
### Overview

1. Removes long polling support from Coordinator client.
2. Removes dependency on `isomorphic-ws`.
3. Updates some packages and Node to 22 (current LTS).

---------

Co-authored-by: Matvei Andrienko <[email protected]>
  • Loading branch information
oliverlaz and myandrienko authored Nov 26, 2024
1 parent 3c81092 commit 921b820
Show file tree
Hide file tree
Showing 20 changed files with 421 additions and 1,236 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-react-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x
cache: 'yarn'

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/egress-composite-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x
cache: 'yarn'

- name: ESLint Cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x
cache: 'yarn'

- name: ESLint Cache
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
14 changes: 5 additions & 9 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@
"@protobuf-ts/runtime": "^2.9.4",
"@protobuf-ts/runtime-rpc": "^2.9.4",
"@protobuf-ts/twirp-transport": "^2.9.4",
"@types/ws": "^8.5.7",
"axios": "^1.6.0",
"base64-js": "^1.5.1",
"isomorphic-ws": "^5.0.0",
"axios": "^1.7.7",
"rxjs": "~7.8.1",
"sdp-transform": "^2.14.1",
"ua-parser-js": "^1.0.36",
"webrtc-adapter": "^8.2.3",
"ws": "^8.14.2"
"webrtc-adapter": "^8.2.3"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.13.4",
Expand All @@ -49,15 +45,15 @@
"@stream-io/node-sdk": "^0.4.3",
"@types/sdp-transform": "^2.4.7",
"@types/ua-parser-js": "^0.7.37",
"@vitest/coverage-v8": "^0.34.4",
"@vitest/coverage-v8": "^2.1.4",
"dotenv": "^16.3.1",
"happy-dom": "^11.0.2",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"rollup": "^4.22.0",
"typescript": "^5.5.2",
"vite": "^5.4.6",
"vitest": "^1.0.0",
"vitest-mock-extended": "^1.2.1"
"vitest": "^2.1.4",
"vitest-mock-extended": "^2.0.2"
}
}
5 changes: 3 additions & 2 deletions packages/client/src/__tests__/Call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { StreamVideoClient } from '../StreamVideoClient';
import 'dotenv/config';
import { StreamClient } from '@stream-io/node-sdk';
import { generateUUIDv4 } from '../coordinator/connection/utils';
import { generateUUIDv4, sleep } from '../coordinator/connection/utils';
import { CallingState } from '../store';
import { Dispatcher } from '../rtc';
import { Call } from '../Call';
Expand All @@ -22,7 +22,7 @@ const secret = process.env.STREAM_SECRET!;
const serverClient = new StreamClient(apiKey, secret);
const userId = 'jane';
const tokenProvider = async () =>
serverClient.createToken(userId, undefined, Date.now() / 1000 - 10);
serverClient.generateUserToken({ user_id: userId, role: 'user' });

let client: StreamVideoClient;

Expand All @@ -34,6 +34,7 @@ beforeEach(async () => {
user: { id: 'jane' },
});

await sleep(50);
await client.streamClient.wsPromise;
});

Expand Down
80 changes: 0 additions & 80 deletions packages/client/src/coordinator/connection/base64.ts

This file was deleted.

Loading

0 comments on commit 921b820

Please sign in to comment.