Commit 351e073
committed
fix: address PR review comments - retry logic, Telegram ok:false handling, and cleanup
- _retry_transient: only retry HTTPError on 5xx and 429 status codes;
permanent 4xx responses now re-raise immediately instead of burning
retries on errors that won't recover.
- _edit_status / _answer_callback / _edit_message_remove_keyboard: use
new _check_telegram_ok helper that raises _TelegramAPIError when
Telegram returns HTTP 200 with {ok: false}, so application-level
failures surface and stop being silently swallowed.
- _edit_status: tighten retries=1/backoff=0.5 (was the default 2/1.0) so
the dispatch hot path can't block ~17s waiting on a flaky edit.
- tests: drop unused 'import time as _time'; expand _retry_transient
coverage for 5xx/429 retry + 4xx no-retry; add coverage for
_check_telegram_ok on ok:true and ok:false bodies.1 parent 939da9a commit 351e073
2 files changed
Lines changed: 119 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
607 | 629 | | |
608 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
609 | 635 | | |
610 | 636 | | |
611 | 637 | | |
612 | | - | |
| 638 | + | |
613 | 639 | | |
614 | 640 | | |
615 | 641 | | |
616 | 642 | | |
617 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
618 | 653 | | |
619 | 654 | | |
620 | 655 | | |
| |||
626 | 661 | | |
627 | 662 | | |
628 | 663 | | |
629 | | - | |
630 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
631 | 668 | | |
632 | 669 | | |
633 | 670 | | |
| |||
702 | 739 | | |
703 | 740 | | |
704 | 741 | | |
705 | | - | |
| 742 | + | |
706 | 743 | | |
707 | 744 | | |
708 | 745 | | |
| |||
732 | 769 | | |
733 | 770 | | |
734 | 771 | | |
735 | | - | |
| 772 | + | |
736 | 773 | | |
737 | 774 | | |
738 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
828 | 827 | | |
829 | 828 | | |
830 | 829 | | |
| |||
857 | 856 | | |
858 | 857 | | |
859 | 858 | | |
860 | | - | |
861 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
862 | 868 | | |
863 | 869 | | |
864 | 870 | | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
869 | 886 | | |
870 | 887 | | |
871 | 888 | | |
872 | 889 | | |
873 | 890 | | |
874 | 891 | | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
0 commit comments