-
Notifications
You must be signed in to change notification settings - Fork 120
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
Rework InputFiles #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem as #28: I don't like putting getters in InputFile
. The checks should be moved to Client
. Perhaps the consumed
field can even be eliminated: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/locked
Why not? We can turn the getter into a function
I looked into this, but I don't want to convert everything back and forth just to save a flag. |
Complexity of file uploads should be contained in either
👍 |
Agree it would not be spread out as it is now. I would prefer to have it in InputFile because what is supported can diverge for both platforms. |
@wojpawlik what do you think about the SoC between |
@KnightNiwrem you're right that the |
@wojpawlik @Loskir @KnightNiwrem can I merge? |
InputFile
instances created from streams and iterators may not be reused. This PR adds a protection that will make the request fail if this is attempted. Previously, an empty or a partial file would be sent.Also see this part of the docs on the issue: https://grammy.dev/advanced/transformers.html#use-cases-of-transformer-functions
Includes #87 and #94.