Skip to content

1.1.1

Choose a tag to compare

@github-actions github-actions released this 03 May 12:07
· 4 commits to main since this release
1.1.1
2c79ca6

Harden update parsing against additive Telegram Bot API changes.

A single getUpdates batch with one unparseable update would crash the entire batch and leave the polling offset un-advanced, causing the caller to re-fetch and re-crash on the same update indefinitely. Observed in production as a 5616-event/9-hour outage triggered by a Bot API 7.0 blockquote entity hitting a strict enum coercion.

Fixed

  • MessageEntityType now includes blockquote (Bot API 7.0) and expandable_blockquote (Bot API 7.2) cases that were missing from the enum.

Added

  • MessageEntity::tryCreate() — tolerant factory that returns null when Telegram emits an entity type the SDK does not yet recognize. The strict MessageEntity::create() is preserved for callers that want to fail loud.
  • GetUpdatesResponse::$parseErrors — public array of throwables captured from per-update parse failures. Callers can iterate this to report failures (e.g. to Sentry) without losing the rest of the batch.

Changed

  • TextMessage::createEntities() now skips entity types the SDK does not recognize via MessageEntity::tryCreate(), so a future additive Bot API change cannot poison the surrounding message parse.
  • GetUpdatesResponse::init() now isolates per-update parse failures: the throwable is recorded in $parseErrors and a GenericUpdate(update_id) is substituted so the caller can advance the polling offset past the bad update. Updates with no integer update_id are dropped from the result entirely.