feat: add configurable parallel video uploads

Allow up to four video upload connections while keeping one connection as the default. Preserve existing messaging interfaces and add configuration controls, reliable failure handling, and upload diagnostics.

Closes #569
This commit is contained in:
DrSmoothl committed 2026-10-24 22:58:46 +08:00
1 parent 3bd74acb60
commit 5c9328206f
18 files changed
+1182 -217

No files matched your search

@@ -132,6 +132,36 @@ describe('pipeline — runNtv2Upload', () => {
setLogLevel(previousLogLevel);
});
it('passes concurrency only for the sub-file that explicitly opts in', async () => {
const bridge = makeBridge({
responseData: encodeOidbResponse({
upload: {
uKey: 'main-key',
subFileInfos: [{ uKey: 'cover-key' }],
msgInfo: { msgInfoBody: [{}, {}], extBizInfo: {} },
},
}),
});
const media = {
bytes: new Uint8Array([1]),
md5: new Uint8Array(16),
sha1: new Uint8Array(20),
};
await runNtv2Upload(
baseParams({
bridge,
uploads: [
{ ...media, source: 'top', cmdId: 1005, concurrency: 4 },
{ ...media, source: 0, cmdId: 1006 },
],
}),
);
const calls = vi.mocked(highway.uploadHighwayHttp).mock.calls;
expect(calls).toHaveLength(2);
expect(calls[0]?.[6]).toEqual({ concurrency: 4 });
expect(calls[1]?.[6]).toBeUndefined();
});
it('records fast-upload selection and one completed media terminal', async () => {
const bridge = makeBridge({
responseData: encodeOidbResponse({