fix(protocol): drop the ineffective video force-full-on-fast-path retry (#145)

forceFullOnFastPath re-issued the NTV2 upload with tryFastUploadCompleted:
false to try to refresh a possibly-expired video resource. Real-machine
testing on a live account + RE of the QQ NT kernel (wrapper.node) proved it
never works:
- the server's fast-path is driven by md5-metadata existence and ignores
  the flag (proton omits a false bool anyway); the retry re-fast-paths
- the kernel itself does no validity check — HandleRspUploadV3 trusts the
  response's fileExist and goes straight to SendUploadSuccFTN

So an expired-but-still-indexed video resource is a platform-level
limitation, not something the upload flow can refresh. Removing the retry
drops two wasted OIDB round-trips per cached-video re-send. The underlying
#145 (receiver '资源已过期' for a server-expired resource) remains a
platform issue, tracked separately.

Tests updated to assert the single-request behaviour.
This commit is contained in:
DrSmoothl committed 2026-06-29 15:32:57 +08:00
1 parent 37f768dd33
commit 053137669a
5 files changed
+29 -162

No files matched your search

@@ -80,14 +80,14 @@ describe('video-upload', () => {
expect(uploads[1]!.fastOnlyError).toBeUndefined();
});
it('main file distrusts a server fast-path (forceFullOnFastPath); thumb does not (#145)', async () => {
// Group/c2c video resources expire server-side: a fast-path hit can
// reference a stale object the receiver shows as "资源已过期", so the
// main file forces a fresh full upload. The thumb stays fast-path-OK.
it('does NOT set a force-full retry flag on the main file (#145 — proven ineffective)', async () => {
// The old forceFullOnFastPath retry was removed: real-machine + kernel RE
// showed it never forces a fresh upload (the server fast-paths by md5
// metadata regardless of tryFastUploadCompleted). An expired-but-indexed
// video resource is a platform limitation, not an upload-flow fix.
await uploadVideoMsgInfo({} as any, true, 12345, FINGERPRINT);
const uploads = vi.mocked(pipeline.runNtv2Upload).mock.calls[0]![0].uploads;
expect(uploads[0]!.forceFullOnFastPath).toBe(true);
expect(uploads[1]!.forceFullOnFastPath).toBeUndefined();
expect((uploads[0] as unknown as Record<string, unknown>).forceFullOnFastPath).toBeUndefined();
});
it('uploadInfo carries TWO entries (main mp4 + thumb jpg) with subFileType 0 and 100', async () => {