Repository navigation
1.1.1
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
MessageEntityTypenow includesblockquote(Bot API 7.0) andexpandable_blockquote(Bot API 7.2) cases that were missing from the enum.
Added
MessageEntity::tryCreate()— tolerant factory that returnsnullwhen Telegram emits an entity type the SDK does not yet recognize. The strictMessageEntity::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 viaMessageEntity::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$parseErrorsand aGenericUpdate(update_id)is substituted so the caller can advance the polling offset past the bad update. Updates with no integerupdate_idare dropped from the result entirely.