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:
5 files changed
+29
-162
No files matched your search
@@ -326,15 +326,13 @@ describe('parseMessage', () => {
|
||||
}], { bridge, groupId: 123456 });
|
||||
|
||||
// The video main file carries real bytes but the server fast-paths it
|
||||
// (fileExist:true, no uKey) — #145's forceFullOnFastPath re-issues the
|
||||
// OIDB request with fast-upload disabled, so two packets go out.
|
||||
expect(bridge.sendRawPacket).toHaveBeenCalledTimes(2);
|
||||
// (fileExist:true, no uKey). The send trusts that single fast-path
|
||||
// response — the old forceFullOnFastPath retry was removed (proven
|
||||
// ineffective, see #145), so exactly ONE OIDB request goes out.
|
||||
expect(bridge.sendRawPacket).toHaveBeenCalledTimes(1);
|
||||
expect(bridge.sendRawPacket).toHaveBeenNthCalledWith(1, 'OidbSvcTrpcTcp.0x11ea_100', expect.any(Uint8Array));
|
||||
expect(bridge.sendRawPacket).toHaveBeenNthCalledWith(2, 'OidbSvcTrpcTcp.0x11ea_100', expect.any(Uint8Array));
|
||||
const firstReq = protobuf_decode<OidbBase<NTV2UploadRichMediaReq>>(bridge.sendRawPacket.mock.calls[0]![1] as Uint8Array);
|
||||
const secondReq = protobuf_decode<OidbBase<NTV2UploadRichMediaReq>>(bridge.sendRawPacket.mock.calls[1]![1] as Uint8Array);
|
||||
expect(firstReq.body.upload.tryFastUploadCompleted).toBe(true);
|
||||
expect(secondReq.body.upload.tryFastUploadCompleted ?? false).toBe(false);
|
||||
expect(protoElems).toHaveLength(1);
|
||||
expect(protoElems[0].commonElem?.serviceType).toBe(48);
|
||||
expect(protoElems[0].commonElem?.businessType).toBe(21);
|
||||
|
||||
Reference in new issue
Block a user