From 3013a60a74984ad65ed0b8e31ff6765eefe28105 Mon Sep 17 00:00:00 2001 From: daylightsavings Date: Fri, 3 Jul 2026 01:34:46 -0400 Subject: [PATCH] Fix stalled SP/mono upload over Remote NetMD The remote upload path passed the raw recording codec (SPS/SPM) straight to WireformatDict, which only keys on wireformat names (SP/LP2/LP105/LP4). The lookup returned undefined, so the encrypting MDTrack had no frame size, the packet worker produced nothing, and the upload hung at 0%. Mirror the direct-USB path (netmd.ts) by collapsing SPS/SPM to SP before the lookup, matching the existing client/server wireformat contract. --- src/services/interfaces/remote-netmd.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/services/interfaces/remote-netmd.ts b/src/services/interfaces/remote-netmd.ts index f7d83be..6bb7e35 100644 --- a/src/services/interfaces/remote-netmd.ts +++ b/src/services/interfaces/remote-netmd.ts @@ -213,7 +213,16 @@ export class NetMDRemoteService extends NetMDService { progressCallback: (progress: { written: number; encrypted: number; total: number }) => void ) { return new Promise((res, rej) => { - const format = _format.codec === 'AT3' ? { codec: _format.bitrate === 66 ? 'LP4' : 'LP2' } : _format; + // The direct-USB path (netmd.ts) collapses the SPS/SPM recording codecs + // to the 'SP' wireformat before looking them up in WireformatDict; the + // remote path must do the same, otherwise WireformatDict['SPS'] is + // undefined and the encryption worker produces no packets (upload hangs). + const format = + _format.codec === 'AT3' + ? { codec: _format.bitrate === 66 ? 'LP4' : 'LP2' } + : _format.codec === 'SPS' || _format.codec === 'SPM' + ? { codec: 'SP' } + : _format; const servURL = new URL(this.server); const wsURL = new URL(`${servURL.protocol === 'https:' ? 'wss:' : 'ws:'}//${servURL.host}/upload`); //Send file