Closed slavafomin closed 2 years ago
@KnorpelSenf please check it out and let me know if something needs to be fixed. Maybe some other error codes need to be added that you know of?
I've tested it for 409
error and it seems to work correctly.
What do you think about handling all the cases from the core package? I am referring to the code I linked at https://github.com/grammyjs/runner/issues/7#issuecomment-1030649568
What do you think about handling all the cases from the core package? I am referring to the code I linked at #7 (comment)
Yep, I'm planning to do this.
By the way, regarding the idea of extracting the error handling logic. Have you considered merging the runner
into the core package? I'm not sure why they are separated in the first place.
Mostly because we never had a reason to merge them. They're concerned with unrelated tasks. In fact, the runner is a library for arbitrary concurrent long polling of any API. Having this clear SoC helped a lot in the early days when designing the packages.
Also, maybe the grammY could use a single polling mechanism out of the box? Is it really worth it to have two separate implementations? I guess it could just confuse new developers with too much choices.
What do you think about handling all the cases from the core package?
Do you want to preserve the debug logging for each error code? Or should I just add the error codes to the list?
Yes, the having different ways to run the bot account for different groups of library consumers. It's a lesson from Telegraf that there's no silver bullet here, so somehow merging the two strategies is making it worse for both groups.
Also, so far no one has come up with an idea how this could work.
What do you think about handling all the cases from the core package?
Do you want to preserve the debug logging for each error code? Or should I just add the error codes to the list?
The debug logs don't need to be as accurate as for the built-in polling.
Yes, the having different ways to run the bot account for different groups of library consumers. It's a lesson from Telegraf that there's no silver bullet here, so somehow merging the two strategies is making it worse for both groups.
Also, so far no one has come up with an idea how this could work.
I guess it could be just a single built-in runner with configurable behavior. It will allow to consolidate all the code in one place and reuse the things like error handlers for example.
@KnorpelSenf I've just added other error codes from the core package.
@slavafomin I fixed this up, can I merge?
@slavafomin any updates?
Signed-off-by: Slava Fomin II slava@fomin.io
This should address #7.