You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a question about how webhooks are handled in teloxide.
Currently, teloxide receives a webhook, parses the request body, sends the update to an mpsc::unbounded_channel, and immediately responds to Telegram with StatusCode::OK.
Is this the correct way to handle a webhook? Shouldn't the StatusCode::OK be returned only after the update is fully processed? It seems to me that this is what Telegram intended.
If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook.
Also, the setWebhook method has a max_connections parameter:
The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
This parameter wouldn't make much sense if the API authors expected bots to respond immediately and just push updates into a queue.
What are your thoughts on this? Do you think teloxide should wait for update processing to complete before replying with 200 OK?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello, I have a question about how webhooks are handled in teloxide.
Currently,
teloxidereceives awebhook, parses the request body, sends the update to anmpsc::unbounded_channel, and immediately responds to Telegram withStatusCode::OK.Is this the correct way to handle a
webhook? Shouldn't theStatusCode::OKbe returned only after the update is fully processed? It seems to me that this is what Telegram intended.For example, in the documentation:
https://core.telegram.org/bots/api#making-requests-when-getting-updates
If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook.Also, the
setWebhookmethod has amax_connectionsparameter:The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.This parameter wouldn't make much sense if the API authors expected bots to respond immediately and just push updates into a queue.
What are your thoughts on this? Do you think teloxide should wait for update processing to complete before replying with 200 OK?
All reactions