Changelog¶
0.9 — changes since 0.8.5¶
Channel comments¶
- Added high-level operations to send, fetch, retrieve, edit, and delete channel-post comments.
- Added comment reactions, subscriptions, counters, author blocking, bulk user-comment deletion, and enabling/disabling comments for a channel.
fetch_comments(..., get_chat=True)can return the boundChattogether with messages or IDs.- Added
CommentsInfoandCommentsInfoUpdatedomain models and boundChat.set_comments().
Messages¶
send_message(),Message.answer(), andMessage.reply()acceptsend_atas an absolutedatetime, relativetimedelta, or Unix timestamp in seconds.- Scheduled history can be requested with
item_type="DELAYED".
Client versions and Android fingerprints¶
- Added
VersionApi/VersionCatalog, a bundled APK fingerprint catalog, and optional remote catalog merging. - Added
app_version,app_fingerprint,version_api(catalogalias), andstrict_fingerprint_pairconfiguration. - Added
MaxApi.app_version,get_available_app_versions(),set_app_version(), andset_random_app_version(); live version changes may reconnect automatically. - Unknown Android versions can run without a fingerprint unless strict pairing is enabled.
- Added automatic version rotation after an unsupported-client response, controlled by
autochange_app_version_if_current_unsupported.
Lifecycle and resilience¶
- Added
DisconnectEventandUnsupportedClientVersionEventwithRouter.disconnectandRouter.unsupported_client_versionobservers. MaxApi(dispatcher=...)can preload lifecycle listeners before connection, so initialization-time disconnect/version events are observable.Dispatcher.start_polling()also installs and removes them automatically.- Added
reconnect,reconnect_delay, andrelogindirectives. - Added independent configurable circuit breakers for transport and API failures, including cooldown, half-open probes, exponential recovery delay, and fail-fast/wait behavior.
- Cancellation, request correlation IDs, retries, reconnect, and relogin paths were hardened against races.
Dispatcher and raw responses¶
- Added
RawUpdateMode. The defaultTRANSLATED_ONLYpreserves previous behavior;ALL_RESPONSESlets update outer middleware observe protocol errors and translation failures. - Added
UpdateTranslationFailureto the middleware data when translation fails.
Packaging and compatibility¶
- Added CI workflows for tests, quality checks, package builds, and documentation.
- Socket transport includes the required Russian trust certificate and the obsolete token-file utilities were removed.
0.8.5 — changes since 0.8¶
Client lifecycle¶
- Client construction and connection can now be separated with
ExtraConfig(auto_connect_after_init=False), followed by explicitawait api.connect(). - Added
request_shutdown(),shutdown_requested,wait_for_shutdown(),wait_until_ready(), and idempotentstop(). - Graceful shutdown now stops polling and mapper tasks, waits for in-flight dispatcher work, drains queued session writes, and closes storage.
- Failed updates are isolated so one update does not terminate the polling loop.
Configuration and backend stack¶
- Added
ExtraConfig, per-layer configuration models, and Smart Init: selectingDeviceTypefills every unspecified layer from a compatible preset, while constructor arguments overrideExtraConfig, which overrides preset defaults. - Added
DeviceTypeand typed transport, encoding, protocol, and mapper registries. - Added a distinct encoding layer. Web uses
JsonEncoding; Desktop and Android useMsgPackDictEncoding. The old socket-envelope adapter was removed. - Added
auto_connect_after_initandrestore_user_agent_from_sessiondirectives. - Added Web, Desktop, and Android user-agent configuration models, including restoration of the original fingerprint from a session.
- Added configurable request/connect timing, telemetry, proxy, endpoint, WebSocket frame size, registration, and synchronization overrides.
Sessions and authentication¶
- Added persistent asynchronous SQLite session storage and a replaceable
BaseSessionStoragecontract. - Tokens, phone, device identity, user-agent data, and sync state are restored and updated asynchronously.
- Added modular
AuthInteractor,TerminalAuthInteractor, andAuthCallbacksfor QR, SMS, and interactive 2FA input. - Added mapper
start_auth_flow()/end_auth_flow()integration and typed genericAuthFlowmiddleware.
Dispatcher and events¶
MaxApi(dispatcher=...)can preload lifecycle listeners for events emitted during authentication. This does not bind the dispatcher to that client: the same dispatcher can be passed to multipleMaxApiinstances.- Added optional bounded concurrent dispatch with
concurrent_task_dispatchandconcurrent_task_count. - Added handler
soft_propagate(default:False) to control dependency-injection strictness. When enabled, a parameter receivesNoneinstead of raisingAnnotationErrorboth when it has no annotation and when its annotation has no matching value in the DI/workflow context. It does not continue the update to another handler. - Filter-produced dependency data is preserved while handlers are checked.
- Added typed
MessageReadEvent,TypingEvent,PresenceEvent, andMessageDeleteEventtranslation and observers.
Models and methods¶
- Chat history can optionally resolve its chat and bind returned objects to the client.
- Bound chat history and several lifecycle/error paths were corrected.
- Mapper transport errors and request cancellation handling were made more explicit.
See configuration and sessions, backend layers, and methods and mapper calls for the new extension surface.