-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using UploadRequest
and DownloadRequest
for FileBox after Dec 31, 2022
#185
Comments
Why not use |
wechaty:1.20.2
|
Thanks for the suggestion and question, @zpaimon ! For your first question about defiling a
To brief short:
The reason we use the above design is that when we are using gRPC stream API, it's hard to pass parameters. (refer to #96 ) For your second question, please learn more about our new UUID FileBox design from this PR: And the current code base of the wechaty-puppet-service will do that:
You can read the source code about the above logic, and please feel free to let me know if you have more questions. |
How to force wechaty to use new gRPC design? If I don't implement MessageStream method,it will throw |
That's a good question. We can think about the below two solutions:
|
Thank you very much! I make it work under my wework protocol project(code: |
That's awesome; great to know that! Do you have any plan for publishing the |
I'm working hard at |
@huan who can help me to test |
My suggestion is to post an alpha testing announcement in our blog post (or GitHub issue), then tell our developers in the WeChat contributors & developers' home group to let them contact you with the alpha testing (distribute marbas TOKEN to them) Feel free to let me know if you need any help from my side. |
The download does not respond when the download exceeds 90K |
We will remove three gRPC interfaces after Dec 31, 2022:
MessageFileStreamMessageImageStreamMessageSendFileStreamgrpc/proto/wechaty/puppet.proto
Lines 66 to 72 in 6809281
The removal of them is because we need to simplify the design and make it more robust and scalable with our infrastructure.
The New Way
gRPC
We are using the below four new abstracted interfaces
UploadRequest
,UploadResponse
,DownloadRequest
, andDownloadResponse
in the future, for simplification.grpc/proto/wechaty/puppet/download-upload.proto
Lines 7 to 19 in 9dfa195
gRPC Related Code
DownloadRequest
A
DownloadRequest
can convert aUUID
toStream
:https://github.com/wechaty/puppet-service/blob/ef72d99747c037cad48e532c0797737adffc0c2b/src/file-box-helper/uuidify-file-box-grpc.ts#L27-L35
UploadRequest
A
UploadRequest
can convert aStream
toUUID
:https://github.com/wechaty/puppet-service/blob/ef72d99747c037cad48e532c0797737adffc0c2b/src/file-box-helper/uuidify-file-box-grpc.ts#L44-L59
Using
UUID
type ofFileBox
Url
,QRCode
,Uuid
, etc., then it can be serialized byfileBox.toString()
Stream
,Buffer
,File
, etc, then it needs to be converted to typeUuid
before serialized byfileBox.toString()
Check if the FileBox should be converted to UUID
https://github.com/wechaty/puppet-service/blob/ef72d99747c037cad48e532c0797737adffc0c2b/src/server/puppet-implementation.ts#L83-L93
Convert a FileBox from Stream (etc.) types to UUID type
https://github.com/wechaty/puppet-service/blob/ef72d99747c037cad48e532c0797737adffc0c2b/src/file-box-helper/normalize-filebox.ts#L72-L79
CC @zpaimon
The text was updated successfully, but these errors were encountered: