REPOSITORY / ScuroNeko/Laniakea
Releases
-
1.2.0
Stablereleased this
2026-08-20 11:08:45 +03:00 | 4 commits to main since this releasev1.2.0
Added
- Added cancelable background runners through
ContextRunnerFnandNewContextRunner; existingRunnerFnandNewRunnerremain available for compatibility. - Added validated inline-keyboard APIs:
InlineKeyboardButtonBuilder.Validate/Build,InlineKeyboard.Validate/GetValidated, andCallbackData.EncodeValidated, with typed errors for invalid actions, callback-data length, and oversized rows. - Added bounded file-download helpers
GetFileByLinkLimitandGetFileByLinkLimitWithContextwithErrFileTooLarge; existing unbounded and streaming helpers remain available. - Added strict root rich-message parsing through
UnmarshalRichMessageStrictand structural rich JSON depth/node limits withErrRichJSONDepthandErrRichJSONNodes. - Added
APIOpts.SetMaxRetriesfor Telegram 429 responses. Automatic JSON and multipart retries now default to at most three attempts after the initial request and returnErrRetryLimitwhen exhausted. - Added
SetChatPhotoWithContextand the correctly pluralizedDeleteAllMessageReactionsWithContext; the old singular compatibility alias remains deprecated until v2. - Added
PollAnswer.VoterUserandPollAnswer.VoterChatInfopresence 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
CommandScopeUpdateErrorand command-generation validation errors so callers can inspect invalid commands, duplicate names, invalid descriptions, and partially updated Telegram scopes. - Added rich-message editing helpers
MessageContext.EditCallbackRich,MessageContext.UpsertKeyboardRich,AnswerMessage.EditRich, andAnswerMessage.EditRichKeyboard, plusAnswerMessage.RichHTMLfor rendered rich content. - Added
NewBotWithAPIfor constructing a bot with a preconfigured, injectable Telegram API client.
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 shutdown cancels callback contexts, drains queued events, and reports callbacks that ignore cancellation.
- Scene routing now holds a lock only for the active session key; updates without an active scene and unrelated user sessions in the same chat remain concurrent.
- 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, injectable API clients, bounded retries and downloads, streaming multipart uploads, keyboard validation, and asynchronous observer delivery.
- Version metadata now reports
v1.2.0.
Fixed
- Fixed HTTP transport errors exposing the bot token through Bot API request and file-download URLs while preserving error-chain inspection.
- 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
AsUserErrorvalues 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.BindArgsaccepting 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
SceneActionvalues 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_aftervalues 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, andquote_parse_mode. - Fixed
MessageContexttext, photo, caption, rich-message, and chat-action helpers omitting business connection identifiers; message-backed helpers now also reject missing chats instead of panicking, while inline edits remain supported without a chat-backed message. - Fixed chat-admin, chat-creator, and bot-admin policies ignoring cancellation and deadlines from the active
MessageContext. - Fixed command parsing treating tabs and newlines as part of command names and matching addressed bot usernames case-sensitively.
- Fixed nested
RichTextArrayvalues bypassing rich-message depth validation and renderer limits. - Fixed polling panics being reported only through telemetry while
RunWithContextreturned success. - Fixed asynchronous middleware outliving the bot runtime and normal middleware denials being reported as internal handler errors.
- Fixed caller-owned or aliased bot loggers being closed by the framework, bot-owned aliases being closed more than once, and replaced internal loggers leaking resources.
- Fixed configuration codecs and JSON option encoding panicking on nil inputs.
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.
- Corrected draft-provider Godoc to avoid promising cryptographic unpredictability from
math/rand/v2IDs. - Marked v1 compatibility surfaces that may change in v2:
PollAnswervoter 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. - Clarified that drop-overflow mode rejects outgoing API requests, one-shot asynchronous runners are awaited during shutdown, and pending uploads are drained by the shared API client.
CI
- Pinned the lint workflow to Go
1.26.6,golangci/golangci-lint-action@v9.0.0, and golangci-lintv2.12.2for reproducible analysis.
Tests
- Added regression coverage for limiter concurrency and cooldown behavior, scene lock scope, all scene handler error paths, polling, handler, and worker panics, asynchronous observer delivery, cancellation, and bounded shutdown, asynchronous middleware lifecycle, logger ownership, runner and policy cancellation, nil configuration inputs, draft cleanup, command parsing, command validation and partial scopes, keyboard byte boundaries and rows, MarkdownV2 vectors, numeric binding boundaries, rich JSON and renderer depth limits, strict rich roots, rich-message editing, business-message helpers and photo replacement, bounded file downloads, retry caps, streaming multipart replay, and corrected Telegram wire keys.
Full Changelog: v1.1.0...v1.2.0
Downloads
- Added cancelable background runners through