-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
sendPhoto silently does nothing? #137
Comments
Hi @lawik, I've pushed branch Could you play there and check again? Start the bot from that branch:
then from a telegram client send to your bot the command If you can pin the variables that give you the issue will be easier to backtrack the root cause. |
Some constraints on photos are described here (max 10 MB, ...) https://core.telegram.org/bots/api#sendphoto @gun_config Application.compile_env(:telegram, :gun_config,
timeout: 60_000,
connect_timeout: 5_000,
certificates_verification: true) |
Did some fun debugging. My images were slightly bigger, 211Kb and up. Not big by any means but bigger than 6.3Kb that you have for testing. So yours is just under 64Kb :) I tried padding your image with 1Kb of nulls until a send failed. I was okay sending 64745 bytes. |
So yes, your example works. No other image I have will :D |
Oh, and it never returns. It idles for 30 seconds and then times out and retries. |
Ahh! |
It also happens with both I just tried switching the entire client to Hackney. Went through, no issue. So this is probably an issue with Gun then. Seems similar to this: elixir-tesla/tesla#230 |
Exactly what I expected! Honestly, the HTTP side of things is really horrible Erlang/Elixir side. |
Well found! That is the exact issue but not the same HTTP client. |
Is there a particular reason this library configures Gun and not another HTTP library? Can it be overridden with config? I don't have time to figure out the Tesla problem but switching to Hackney seems to work fine. |
No particular reason. The tesa client adapter and its config could be made configurable, ie the library user can choose what to use or just leave the default (hackney). And, by the way, the need to have an HTTP client stays in the pooler, that should be used in dev mode or if serving small amount of traffic. Another way to say it doesn't matter that much what client you use unless you have strong dependency requirements. |
Hey
Playing around with a bot and trying to send a Photo, the multipart request just never completes. I get the log line before but never the one after.
The text was updated successfully, but these errors were encountered: