Skip to content

Commit

Permalink
Merge pull request #77 from juzibot/fix/send-file-with-upload
Browse files Browse the repository at this point in the history
Fix/send file with upload
  • Loading branch information
hcfw007 authored Aug 12, 2024
2 parents 631acdb + 0504fa9 commit ac61e0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 10 additions & 5 deletions src/file-box-helper/uuidify-file-box-grpc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {
Readable,
Writable,
} from 'stream'

import {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ac61e0c

Please sign in to comment.