Skip to content

fix(invite): resolve cached group IDs - #305

Open
skyzer wants to merge 1 commit into
gotd:mainfrom
skyzer:fix/invite-cached-peer-id
Open

skyzer wants to merge 1 commit into
gotd:mainfrom
skyzer:fix/invite-cached-peer-id

Conversation

@skyzer

@skyzer skyzer commented Nov 19, 2026

Copy link
Copy Markdown

Problem

tg invite id:<n> @example_user rejects the ID even after tg chats list
has cached the peer. The invitee uses the CLI's ID-aware resolver, but the
destination previously went straight to the username/link/phone resolver.
This leaves groups without a public username without a numeric target.

Fix

  • Resolve id:<n> destinations through the selected account's existing
    peer cache. Reject a raw ID that matches multiple cached peer types rather
    than guessing the destination. Username and link resolution are unchanged.
  • Return an error when Telegram reports missing invitees, instead of emitting
    ok: true after a partial or unsuccessful invite. Telegram still enforces
    permissions and privacy rules.
  • Document the cached-ID syntax in tg invite --help.

Verification

The mocked regression tests cover private basic groups and supergroups,
the existing username path, uncached and ambiguous IDs, and skipped
invitees. No live sessions or real peer data were used.

  • go test -race ./...
  • go mod tidy -diff
  • golangci-lint v2.12.1: no findings on changed lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant