Skip to content

chore(deps): bump github.com/gotd/td from 0.164.0 to 0.166.0 - #484

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/gotd/td-0.166.0
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/gotd/td-0.166.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Bumps github.com/gotd/td from 0.164.0 to 0.166.0.

Release notes

Sourced from github.com/gotd/td's releases.

v0.166.0

Adds telegram/user, a bootstrap for user accounts next to telegram/bot, and updates the API docs and error constants from getdoc v0.54.0.

Highlights

telegram/user (#1977)

  • user.Start / user.New connect, sign in only if the stored session isn't authorized, and start the updates and peer managers. Session, update state and access hashes of channels and users live in Options.Dir, so updates sent while stopped are delivered after a restart and known channels need no extra getDifference.
  • Sign in with user.Phone (code + 2FA via auth.NewFlow), user.QR (login token, imported on another DC) or user.AuthFunc. With Auth == nil, Start returns ErrNotAuthorized and sends nothing. A bot session or another account than Options.UserID fails with ErrSessionMismatch.
  • FLOOD_WAIT on sign in is waited out (up to MaxLoginWait) only where it can't send a second code: before the code was requested for Phone, always for QR, never for AuthFunc.
  • New example examples/userbot-echo. telegram/bot now shares the internals (telegram/internal/bootstrap); its API and behaviour are unchanged.
  • Docs: User authentication.

API docs and errors (#1979)

  • getdoc v0.54.0: refreshed doc comments and 42 new error constants (e.g. ErrURLExpired, ErrTopicNotModified, ErrBotCreateLimitExceeded).

Upgrading

Eight error constants that Telegram no longer documents are removed: ErrAnonymousReactionsDisabled, ErrEncryptionDeclineAdminFailed, ErrGroupcallAddParticipantsFailed, ErrNeedDocInvalid, ErrParticipantCallFailed, ErrPasskeyAuthRestart, ErrSavedPeerInvalid, ErrVolumeMoveInvalid. Use the string instead, e.g. tgerr.Is(err, "SAVED_PEER_INVALID").

All changes

Full Changelog: gotd/td@v0.165.1...v0.166.0

v0.165.1

Fix for clients whose local clock runs ahead; no other changes since v0.165.0.

Fixes

  • mtproto: start a new session after msg_id too high (#1976). With the local clock ahead of the server (seen with +10 min), v0.165.0 corrected its time offset after bad_msg_notification 17 but kept the same session, whose message ids must stay increasing, so every request was refused again and the client never became ready (initConnection failed in a loop). Like TDLib, gotd now resets the message id generator, starts a new session and resends the request. Verified on production with the clock ±10 min off.

Full Changelog: gotd/td@v0.165.0...v0.165.1

v0.165.0

gotd now talks to Telegram more like Telegram Desktop does, keeps server sessions and other DCs' keys across reconnects and restarts, tolerates a skewed local clock, recovers updates faster after errors, caches peers by default and can log out. Most of these came from comparing gotd's wire traffic with Telegram Desktop's on the same account.

Highlights

Traffic like Telegram Desktop

  • invokeWithLayer is sent only until the connection is inited, then queries go without it; it is re-sent after CONNECTION_NOT_INITED/CONNECTION_LAYER_INVALID (#1964).
  • No get_future_salts: salts come from new_session_created and bad_server_salt (#1965).
  • ping_delay_disconnect(60) every 30–45 s with jitter instead of (75) every 60 s (#1966).
  • upload.getFile sets precise only for unaligned parts (#1958); empty entities vectors are omitted (#1956).

Sessions and clock

  • Session data keeps the auth keys of other DCs (no new transfer after a restart), key age, the server time offset and the self user id; old session files load unchanged, newer formats return ErrVersionUnsupported (#1971, #1974, #1975). New Client.SelfID().
  • The server session (session_id) continues across reconnects with the same key; after the server starts a new session, requests it didn't see are resent and updates are re-fetched (#1972).
  • Server time offset like TDLib: msg_ids follow the spec and use server time, a client clock off by minutes works, and bad_msg_notification 16/17/20 are re-sent (#1968). Options.ServerTimeOffset, Client.ServerTimeOffset().
  • Received messages are deduplicated like TDLib's MessageIdDuplicateChecker, including messages inside containers (#1969).

... (truncated)

Commits
  • f962e7b Merge pull request #1979 from gotd/chore/getdoc-v0.54.0
  • e2dd994 feat: update getdoc to v0.54.0
  • 8610679 Merge pull request #1977 from gotd/feat/user-bootstrap
  • 01d32ea fix(user): don't sign in again after the code was sent
  • 9c885c8 feat(user): add batteries-included user bootstrap
  • ba6e0a6 refactor(bot): move the bootstrap machinery to an internal package
  • 112718a Merge pull request #1976 from gotd/fix/mtproto-msgid-too-high
  • e9c853a fix(mtproto): start a new session after msg_id too high
  • eae692a Merge pull request #1974 from gotd/feat/session-time-offset
  • 778796e Merge pull request #1975 from gotd/fix/telegram-dc-authorized-race
  • Additional commits viewable in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Nov 16, 2026
@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.50%. Comparing base (9727c57) to head (d7eb41a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #484   +/-   ##
=======================================
  Coverage   78.50%   78.50%           
=======================================
  Files         119      119           
  Lines        8579     8579           
=======================================
  Hits         6735     6735           
  Misses       1307     1307           
  Partials      537      537           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Bumps [github.com/gotd/td](https://github.com/gotd/td) from 0.164.0 to 0.166.0.
- [Release notes](https://github.com/gotd/td/releases)
- [Commits](gotd/td@v0.164.0...v0.166.0)

---
updated-dependencies:
- dependency-name: github.com/gotd/td
  dependency-version: 0.166.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot changed the title chore(deps): bump github.com/gotd/td from 0.163.0 to 0.166.0 chore(deps): bump github.com/gotd/td from 0.164.0 to 0.166.0 Nov 16, 2026
@dependabot
dependabot Bot force-pushed the dependabot/go_modules/github.com/gotd/td-0.166.0 branch from 30abaf4 to d7eb41a Compare November 16, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants