diff --git a/package.json b/package.json index af917b8f..2a6c2cde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@juzi/wechaty-puppet-service", - "version": "1.0.97", + "version": "1.0.98", "description": "Puppet Service for Wechaty", "type": "module", "exports": { diff --git a/src/file-box-helper/uuidify-file-box-grpc.ts b/src/file-box-helper/uuidify-file-box-grpc.ts index a11807e5..cb0da221 100644 --- a/src/file-box-helper/uuidify-file-box-grpc.ts +++ b/src/file-box-helper/uuidify-file-box-grpc.ts @@ -1,6 +1,5 @@ import type { Readable, - Writable, } from 'stream' import { @@ -52,11 +51,17 @@ const uuidRegisterGrpc: (grpcClient: () => pbPuppet.PuppetClient) => UuidSaver = } else { resolve(response) } - }) as unknown as Writable // Huan(202203) FIXME: as unknown as + }) + + const initRequest = new pbPuppet.UploadRequest() + request.write(initRequest) + + setImmediate(() => { + stream + .pipe(chunkEncoder(pbPuppet.UploadRequest)) + .pipe(request) + }) - stream - .pipe(chunkEncoder(pbPuppet.UploadRequest)) - .pipe(request) }) const uuid = response.getId()