@@ -1,5 +1,51 @@
|
||||
# Changelog
|
||||
|
||||
## v1.2.0
|
||||
|
||||
### Added
|
||||
- Added cancelable background runners through `ContextRunnerFn` and `NewContextRunner`; existing `RunnerFn` and `NewRunner` remain available for compatibility.
|
||||
- Added validated inline-keyboard APIs: `InlineKeyboardButtonBuilder.Validate`/`Build`, `InlineKeyboard.Validate`/`GetValidated`, and `CallbackData.EncodeValidated`, with typed errors for invalid actions, callback-data length, and oversized rows.
|
||||
- Added bounded file-download helpers `GetFileByLinkLimit` and `GetFileByLinkLimitWithContext` with `ErrFileTooLarge`; existing unbounded and streaming helpers remain available.
|
||||
- Added strict root rich-message parsing through `UnmarshalRichMessageStrict` and structural rich JSON depth/node limits with `ErrRichJSONDepth` and `ErrRichJSONNodes`.
|
||||
- Added `APIOpts.SetMaxRetries` for Telegram 429 responses. Automatic JSON and multipart retries now default to at most three attempts after the initial request and return `ErrRetryLimit` when exhausted.
|
||||
- Added `SetChatPhotoWithContext` and the correctly pluralized `DeleteAllMessageReactionsWithContext`; the old singular compatibility alias remains deprecated until v2.
|
||||
- Added `PollAnswer.VoterUser` and `PollAnswer.VoterChatInfo` presence helpers without changing the v1 value-field layout.
|
||||
- Added typed runtime errors for invalid scene actions, nil handlers, recovered handler panics, oversized Telegram responses, and recovered worker-pool task panics.
|
||||
- Added `CommandScopeUpdateError` and command-generation validation errors so callers can inspect invalid commands, duplicate names, invalid descriptions, and partially updated Telegram scopes.
|
||||
|
||||
### Changed
|
||||
- Runtime observer callbacks now execute asynchronously in enqueue order on one bounded dispatcher instead of blocking update handlers and scene locks. Queue overflow drops events with sampled warnings, observer panics remain isolated, and runtime shutdown drains queued events.
|
||||
- Multipart uploads now encode request bodies as streams instead of building a second complete in-memory copy for every attempt.
|
||||
- Logger replacement and app-data logger writer registration now follow the bot configuration freeze, reject nil values safely, and install bot-token redaction before publishing replacement loggers.
|
||||
- README and README_RU now document context runners, bounded retries and downloads, streaming multipart uploads, keyboard validation, and asynchronous observer delivery.
|
||||
- Version metadata now reports `v1.2.0`.
|
||||
|
||||
### Fixed
|
||||
- Fixed per-chat rate-limiter lifecycle races with concurrent cleanup, cooldown waits ignoring a later extension, shorter 429 locks replacing longer locks, and busy chats consuming global capacity before obtaining chat capacity.
|
||||
- Fixed scene `AsUserError` values not reaching users and producing duplicate observer errors; scene step, command, payload, and message-fallback errors now follow one consistent error path.
|
||||
- Fixed nil and panicking command, payload, update, message-fallback, scene, and middleware callbacks breaking handler/observer lifecycles. Panics are recovered per invocation and matching finish/error events are emitted.
|
||||
- Fixed asynchronous middleware error events and policy events bypassing the runtime observer dispatcher.
|
||||
- Fixed Telegram MarkdownV2 custom emoji syntax, multiline expandable blockquotes, code/pre escaping, and unsafe code-fence language strings.
|
||||
- Fixed `MessageContext.BindArgs` accepting values outside the destination integer or floating-point width.
|
||||
- Fixed empty successful draft flushes leaving stale drafts in `DraftProvider`.
|
||||
- Fixed generated command descriptions outside Telegram's 1–256-character range, duplicate command names across plugins, trailing usage whitespace, and silent partial multi-scope updates.
|
||||
- Fixed inline keyboard auto-wrap after reducing `maxRow`; legacy non-positive unlimited rows remain compatible for v1.
|
||||
- Fixed Telegram API responses larger than 10 MiB being silently truncated before JSON parsing; they now return `ErrResponseTooLarge`.
|
||||
- Fixed unknown `SceneAction` values being treated as a normal unhandled result.
|
||||
- Fixed worker-pool task panics terminating a worker and leaving the caller without a result.
|
||||
- Fixed zero or negative Telegram `retry_after` values causing a tight retry loop.
|
||||
- Fixed Telegram JSON wire names for `provider_payment_charge_id`, `owned_gift_id`, `others_can_add_tasks`, `others_can_mark_tasks_as_done`, `available_reactions`, and `quote_parse_mode`.
|
||||
|
||||
### Documentation
|
||||
- Added field-level Godoc for the complete exported API surface, including official Telegram Bot API optionality, ranges, formats, and field semantics. The repository-wide AST audit now reports no undocumented exported declarations or struct fields.
|
||||
- Marked v1 compatibility surfaces that may change in v2: `PollAnswer` voter pointers, context-required runners, error-returning keyboard builders, strict rich-message parsing, lossless unknown rich types, bounded downloads, compatibility aliases, and corrected public field names.
|
||||
|
||||
### CI
|
||||
- Pinned the lint workflow to Go `1.26.6`, `golangci/golangci-lint-action@v9.0.0`, and golangci-lint `v2.12.2` for reproducible analysis.
|
||||
|
||||
### Tests
|
||||
- Added regression coverage for limiter concurrency and cooldown behavior, all scene handler error paths, handler and worker panics, asynchronous observer delivery and drain, runner cancellation, draft cleanup, command validation and partial scopes, keyboard byte boundaries and rows, MarkdownV2 vectors, numeric binding boundaries, rich JSON limits and strict roots, bounded file downloads, retry caps, streaming multipart replay, and corrected Telegram wire keys.
|
||||
|
||||
## v1.1.0
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
Reference in New Issue
Block a user