[Bug] Telegram album debounce exceeds the maximum wait

オープン 初心者向け
#11,123 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@123XieC がすでに取り組んでいます。

2026年11月14日 から。

  • #11124 @123XieC による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

TelegramPlatformAdapter.handle_media_group_message から始めてください。ここで telegram_media_group_timeout と telegram_media_group_max_wait から収集ジョブがスケジュールされます。同じアルバムに新しい更新が届いたとき、置き換えジョブの run_date がどのように計算されるかを確認してください。遅れて届いた更新が元の期限以前にスケジュールされていれば完了です(期限をすでに過ぎている場合は即時)。9秒時点の合成更新の後に、スケジュールされた run_date を読み取るテストも含めてください。

索引モデルが issue の本文から書いたものです。

説明

Bug description

Telegram media-group collection can schedule processing after the configured maximum wait. An album whose last part arrives shortly before the deadline is given a new full debounce delay.

Reproduction
  1. Use telegram_media_group_timeout = 2.5 and telegram_media_group_max_wait = 10.0, the defaults.
  2. Deliver an album update at elapsed time zero to TelegramPlatformAdapter.handle_media_group_message. This schedules its collection job for 2.5 seconds.
  3. On a busy event loop where that job has not run, deliver another update for the same album at elapsed time 9 seconds. Continuous updates in smaller gaps can also keep rescheduling the job until this point.
  4. Read the scheduled run_date of the replacement job.
Actual result

The new run time is 11.5 seconds after the first update, beyond the configured 10-second cap.

Expected result

The new run time is the earlier of the debounce time and the original deadline. An album received after its deadline should be scheduled for immediate processing.

Environment

AstrBot source at 23db1ad08064a8330a09077138ce8ecc05362219 on macOS, Python 3.12. Reproduced with synthetic Telegram updates and the actual adapter handler. No Telegram bot token or network call is needed.

主要言語
Python
スター
46.4k
フォーク
3.4k
平均マージ
1日 10時間
マージ済み PR(30日)
111

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AstrBotDevs/AstrBot のほかの issue

AstrBotDevs/AstrBot の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。