From 76b64886daf9776af3f2baa69c463f02061fcdf4 Mon Sep 17 00:00:00 2001 From: Alois Date: Mon, 6 Jul 2026 21:45:57 +0200 Subject: [PATCH] (fix): calls (fix): deepfilternet3 (feat): remove noise gate logs (qol): update todo --- apps/web/src/index.tsx | 3 +- licenses/THIRD_PARTY_NOTICES.md | 4 +-- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 licenses/sbom.cyclonedx.json | 10 +++---- licenses/third-party-credits.json | 6 ++-- packages/call/package.json | 2 +- packages/call/src/speakingIndicator.ts | 3 -- packages/call/src/store.tsx | 28 ++++++++++++++++--- pnpm-lock.yaml | 10 +++---- todo.md | 1 + 11 files changed, 42 insertions(+), 25 deletions(-) rename licenses/{deepfilternet3-noise-filter@1.3.0 => deepfilternet3-noise-filter@1.2.1}/LICENSE-APACHE (100%) rename licenses/{deepfilternet3-noise-filter@1.3.0 => deepfilternet3-noise-filter@1.2.1}/LICENSE-MIT (100%) diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx index 02ec8c2..bbfb2dd 100644 --- a/apps/web/src/index.tsx +++ b/apps/web/src/index.tsx @@ -275,8 +275,7 @@ function AppShell() { } function CallInit() { - useInitializeCall(); - return null; + return useInitializeCall(); } const rootRoute = createRootRoute({ diff --git a/licenses/THIRD_PARTY_NOTICES.md b/licenses/THIRD_PARTY_NOTICES.md index f73299f..d17e50b 100644 --- a/licenses/THIRD_PARTY_NOTICES.md +++ b/licenses/THIRD_PARTY_NOTICES.md @@ -744,14 +744,14 @@ Generated from pnpm-lock.yaml and installed packages in workspace node_modules f - Folder: `licenses/decimal.js-light@2.5.1` - Source package dir: `apps/web/node_modules/decimal.js-light` -## deepfilternet3-noise-filter@1.3.0 +## deepfilternet3-noise-filter@1.2.1 - License: (Apache-2.0 OR MIT) - Homepage: https://github.com/mezonai/mezon-noise-suppression#readme - Repository: git+https://github.com/mezonai/mezon-noise-suppression.git - Description: Custom audio processor with DeepFilterNet3 noise filtering integrated with LiveKit client - Included files: LICENSE-APACHE, LICENSE-MIT -- Folder: `licenses/deepfilternet3-noise-filter@1.3.0` +- Folder: `licenses/deepfilternet3-noise-filter@1.2.1` - Source package dir: `packages/call/node_modules/deepfilternet3-noise-filter` ## detect-node-es@1.1.0 diff --git a/licenses/deepfilternet3-noise-filter@1.3.0/LICENSE-APACHE b/licenses/deepfilternet3-noise-filter@1.2.1/LICENSE-APACHE similarity index 100% rename from licenses/deepfilternet3-noise-filter@1.3.0/LICENSE-APACHE rename to licenses/deepfilternet3-noise-filter@1.2.1/LICENSE-APACHE diff --git a/licenses/deepfilternet3-noise-filter@1.3.0/LICENSE-MIT b/licenses/deepfilternet3-noise-filter@1.2.1/LICENSE-MIT similarity index 100% rename from licenses/deepfilternet3-noise-filter@1.3.0/LICENSE-MIT rename to licenses/deepfilternet3-noise-filter@1.2.1/LICENSE-MIT diff --git a/licenses/sbom.cyclonedx.json b/licenses/sbom.cyclonedx.json index 832ae16..e5f7673 100644 --- a/licenses/sbom.cyclonedx.json +++ b/licenses/sbom.cyclonedx.json @@ -2651,10 +2651,10 @@ }, { "type": "library", - "bomRef": "pkg:npm/deepfilternet3-noise-filter@1.3.0", + "bomRef": "pkg:npm/deepfilternet3-noise-filter@1.2.1", "name": "deepfilternet3-noise-filter", - "version": "1.3.0", - "purl": "pkg:npm/deepfilternet3-noise-filter@1.3.0", + "version": "1.2.1", + "purl": "pkg:npm/deepfilternet3-noise-filter@1.2.1", "description": "Custom audio processor with DeepFilterNet3 noise filtering integrated with LiveKit client", "licenses": [ { @@ -2676,7 +2676,7 @@ "properties": [ { "name": "local:licenseFolder", - "value": "licenses/deepfilternet3-noise-filter@1.3.0" + "value": "licenses/deepfilternet3-noise-filter@1.2.1" }, { "name": "local:sourcePackageDir", @@ -4851,4 +4851,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/licenses/third-party-credits.json b/licenses/third-party-credits.json index e4e3f81..81d1ba8 100644 --- a/licenses/third-party-credits.json +++ b/licenses/third-party-credits.json @@ -368,7 +368,7 @@ }, { "name": "@radix-ui/react-slot", - "version": "1.3.0", + "version": "1.2.1", "license": "MIT", "homepage": "https://radix-ui.com/primitives", "repository": "git+https://github.com/radix-ui/primitives.git", @@ -1027,7 +1027,7 @@ "LICENSE-APACHE", "LICENSE-MIT" ], - "licenseFolder": "licenses/deepfilternet3-noise-filter@1.3.0", + "licenseFolder": "licenses/deepfilternet3-noise-filter@1.2.1", "sourcePackageDir": "packages/call/node_modules/deepfilternet3-noise-filter" }, { @@ -1847,4 +1847,4 @@ "sourcePackageDir": "packages/call/node_modules/zustand" } ] -} \ No newline at end of file +} diff --git a/packages/call/package.json b/packages/call/package.json index 2af3898..79111fb 100644 --- a/packages/call/package.json +++ b/packages/call/package.json @@ -25,7 +25,7 @@ "@tensamin/mtp": "workspace:*", "@tensamin/ui": "*", "@tensamin/user": "workspace:*", - "deepfilternet3-noise-filter": "^1.2.1", + "deepfilternet3-noise-filter": "1.2.1", "livekit-client": "^2.18.8", "lucide-react": "^1.14.0", "react": "^19.2.0", diff --git a/packages/call/src/speakingIndicator.ts b/packages/call/src/speakingIndicator.ts index 8f05eb8..a887516 100644 --- a/packages/call/src/speakingIndicator.ts +++ b/packages/call/src/speakingIndicator.ts @@ -1,4 +1,3 @@ -import { log } from "@tensamin/shared/log"; import { clearSpeakingParticipants, removeSpeakingParticipant, @@ -138,10 +137,8 @@ class SpeakingDetector { const db = 20 * Math.log10(Math.max(rms, 0.0001)); if (!this.localMicGateClosed && db < this.gateThresholdStart) { - log(3, "noise gate", "purple", "closed"); this.muteLocalTrack(true); } else if (this.localMicGateClosed && db > this.gateThresholdEnd) { - log(3, "noise gate", "purple", "opened"); this.muteLocalTrack(false); } } diff --git a/packages/call/src/store.tsx b/packages/call/src/store.tsx index 7cca709..b5da895 100644 --- a/packages/call/src/store.tsx +++ b/packages/call/src/store.tsx @@ -646,7 +646,7 @@ export async function openCallPage(callId: string) { // Request the LiveKit token that authorizes this client to join a call. export async function getCallToken(callId: string): Promise { const response = await requireRuntime(useCall.getState().runtime) - .send("call_token", { + .send("CallToken", { CallId: callId, }) .catch((err) => { @@ -679,7 +679,7 @@ export async function sendCallInvite(userId: number) { version: CALL_SECRET_VERSION, }); - await runtime.send("call_invite", { + await runtime.send("CallInvite", { ReceiverId: userId, CallId: callId, CallSecret: { @@ -1222,7 +1222,7 @@ export function useInitializeCall() { // listen to call invites useEffect(() => { - subscribePush(async (message) => { + return subscribePush(async (message) => { if (message.type !== "CallInvite") return; const { CallId, CallSecret, SenderId } = message.data as { @@ -1231,7 +1231,15 @@ export function useInitializeCall() { SenderId: number; }; - showCallingScreen(CallId, CallSecret, SenderId); + if (SenderId === Number(await load("user_id"))) { + return; + } + + showCallingScreen( + CallId, + normalizeWrappedCallSecret(CallSecret), + SenderId, + ); }); }, [load, subscribePush, showCallingScreen]); @@ -1564,6 +1572,18 @@ export function useInitializeCall() { send("CallData", { CallId: callId }) .then((data) => { + if (data.type === "ErrorNotFound") { + setCurrentCallData({ + UserIds: [], + exists: false, + }); + return; + } + + if (data.type.startsWith("Error")) { + throw new Error(`CallData failed: ${data.type}`); + } + setCurrentCallData({ ...(data.data as z.infer), exists: true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 099ec42..f8ee2af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -529,8 +529,8 @@ importers: specifier: workspace:* version: link:../user deepfilternet3-noise-filter: - specifier: ^1.2.1 - version: 1.3.0(livekit-client@2.20.0(@types/dom-mediacapture-record@1.0.22)) + specifier: 1.2.1 + version: 1.2.1(livekit-client@2.20.0(@types/dom-mediacapture-record@1.0.22)) livekit-client: specifier: ^2.18.8 version: 2.20.0(@types/dom-mediacapture-record@1.0.22) @@ -2690,8 +2690,8 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - deepfilternet3-noise-filter@1.3.0: - resolution: {integrity: sha512-yYFUlPuvPguqcd/R6/OSsr0noGqlqOE50JkCWYHogk+PjLj9qrNgwTt5zKraVkKnw0l4+eXJagkz2SUWtUl4sQ==} + deepfilternet3-noise-filter@1.2.1: + resolution: {integrity: sha512-OAyrHTDlUHH+AhfpVNKYEOhVqb9cZpu0fdNThplA/tB/Ts4PF/UsI+abl2n1IbSxUkhiF0OqDejEhk1n42Oqpw==} engines: {node: '>=18.0.0'} peerDependencies: livekit-client: ^2.0.0 @@ -6786,7 +6786,7 @@ snapshots: deep-is@0.1.4: {} - deepfilternet3-noise-filter@1.3.0(livekit-client@2.20.0(@types/dom-mediacapture-record@1.0.22)): + deepfilternet3-noise-filter@1.2.1(livekit-client@2.20.0(@types/dom-mediacapture-record@1.0.22)): dependencies: livekit-client: 2.20.0(@types/dom-mediacapture-record@1.0.22) diff --git a/todo.md b/todo.md index d3665c2..6927b1a 100644 --- a/todo.md +++ b/todo.md @@ -1,2 +1,3 @@ - Move legal to extra onboarding package - Add a bunch of tests +- Add packages/cache/ to handle caching