book icon indicating copy to clipboard operation
book copied to clipboard

docs: add question to faq about concurrency of updates

Open elementh opened this issue 1 year ago • 7 comments

This knowledge is not easily available, and it's not what you would expect that will happen when using webhooks, specially with ASP.NET Core.

Let me know if the format is not correct or if more changes are needed.

PD: I've made the PR towards develop, as specified in the CONTRIBUTING.md, since it seems that it hasn't been used in a long time, there are extra commits bundled in this PR (I've only authored 3). Let me know if you want me to change this towards master.

elementh avatar Aug 27 '24 15:08 elementh

@wiz0u any input? :smiley:

elementh avatar Sep 05 '24 09:09 elementh

what is this mess? XD why a PR from last week shows a lot of old commits?

wiz0u avatar Sep 06 '24 20:09 wiz0u

you probably forked your repo a long time ago and only made the changes recently or something

wiz0u avatar Sep 06 '24 21:09 wiz0u

ok I've seen the differences directly on your repo

My opinion is that FAQ must be frequent. I'd rather not have anybody contribute directly to FAQ, but rather ask their question in the group, and if it becomes a frequent question, I will add it to the FAQ.

Now your point for Q28 is still interesting so it could be added directly in webhook.md. I suggest you close this PR, close your fork. Then go directly online at https://github.com/TelegramBots/book/edit/master/src/3/updates/webhook.md and insert your change directly in there (you should be able to commit it online automatically as a branch+PR)

I also suggest you merge your stuff within the existing block that speak on a similar matter:

  • If your update handler throws an exception or takes too much time to return, Telegram will consider it a temporary failure and will RESEND the same update a bit later.
    You may want to prevent handling the same update.Id twice:

wiz0u avatar Sep 06 '24 21:09 wiz0u

you probably forked your repo a long time ago and only made the changes recently or something

No, I simply did the PR towards develop (as CONTRIBUTING.md says), but you've been committing directly to main/master 😂

elementh avatar Sep 06 '24 21:09 elementh

I reread your stuff, no need to merge to existing block as I said, add it at the end

wiz0u avatar Sep 06 '24 21:09 wiz0u

ok I've seen the differences directly on your repo

My opinion is that FAQ must be frequent.

I'd rather not have anybody contribute directly to FAQ, but rather ask their question in the group, and if it becomes a frequent question, I will add it to the FAQ.

Now your point for Q28 is still interesting so it could be added directly in webhook.md.

I suggest you close this PR, close your fork. Then go directly online at https://github.com/TelegramBots/book/edit/master/src/3/updates/webhook.md

and insert your change directly in there (you should be able to commit it online automatically as a branch+PR)

I also suggest you merge your stuff within the existing block that speak on a similar matter:

  • If your update handler throws an exception or takes too much time to return,

Telegram will consider it a temporary failure and will RESEND the same update a bit later.

You may want to prevent handling the same update.Id twice:

Will check it during the weekend, thanks for the feedback 😄

elementh avatar Sep 06 '24 21:09 elementh

I've included a section about update concurrency in the documentation https://telegrambots.github.io/book/3/updates/webhook.html#updates-are-posted-sequentially-to-your-webapp

wiz0u avatar Dec 03 '24 09:12 wiz0u