Skip to content

feat(people): read Telegram group admins from the bot, without storing them - #98

Closed
BIA3IA wants to merge 1 commit into
chore/remove-legacy-compatfrom
feat/telegram-group-admins-sync
Closed

BIA3IA wants to merge 1 commit into
chore/remove-legacy-compatfrom
feat/telegram-group-admins-sync

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

People needs to know who administers each Telegram group: admins' groups, the Capo Admin area, the census ("which groups do you keep", confirming admin removals). Since Phase 5 nothing provided it, and People has received admins: null (unknown) for every group.

Telegram is the only source of that information (RFC v3 decision 2), so the backend stores nothing:

  • Socket event getGroupAdmins (ToClient): the backend sends the IDs of the groups it stores; the bot answers with the admins it has cached from Telegram, leaving out groups it has not read yet.
  • WSS.getGroupAdmins(): null when no bot is connected or it doesn't answer within 3 seconds, so People pages don't hang on the bot.
  • People builds its groups with telegramGroupsWithAdmins: a group the bot has read has its admin list (possibly empty); a group it hasn't, or every group while the bot is unavailable, stays null, and People keeps what it last knew instead of reading "no admins".

No table, no migration. The list is informative only: it grants no permission.

Stacked on #97. The bot side is PoliNetworkOrg/telegram#159.

Verification

  • bun run typecheck, bunx biome ci, bun run build, bun run build:npm: OK.
  • bun run test with the Postgres integration suites: 296 passed, 1 skipped. New test: groups read by the bot, read with no admins, not read yet, and the bot unavailable.
  • telegram#159 typechecks and its tests pass against the SDK built from this branch.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1de10206-7407-4fc2-bc5b-2222f6b28580

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

BIA3IA added a commit to PoliNetworkOrg/telegram that referenced this pull request Oct 26, 2026
People needs who administers each Telegram group, and Telegram is the only source (RFC v3 decision 2). The bot keeps a cache of getChatAdministrators (without bots) in Redis and answers the backend's getGroupAdmins over the socket; the backend stores nothing.

The cache is refreshed when someone becomes or stops being an admin, once a burst of changes settles; 30 seconds after the bot is promoted in a group; and for every group 2 minutes after startup and every 6 hours, one Telegram request at a time. Entries expire after a day, so a group the bot can no longer read becomes unknown instead of stale.

Needs @polinetwork/backend with getGroupAdmins (PoliNetworkOrg/backend#98).
…g them

People needs who administers each Telegram group (admins' groups, the Capo Admin area, the census), and Telegram is the only source (RFC v3 decision 2). The backend now asks the bot over the socket (getGroupAdmins) for the groups it stores; the bot answers from its cache of Telegram, and nothing is stored here.

A group the bot has not read yet, or every group while the bot does not answer within 3 seconds, stays unknown (null), so People keeps what it last knew instead of reading "no admins".
@BIA3IA
BIA3IA force-pushed the feat/telegram-group-admins-sync branch from da0eae6 to 0a7185d Compare October 26, 2026 19:59
@BIA3IA BIA3IA changed the title feat(telegram): store each group's native admins, reported by the bot feat(people): read Telegram group admins from the bot, without storing them Oct 26, 2026
@BIA3IA BIA3IA closed this Oct 26, 2026
@BIA3IA
BIA3IA deleted the feat/telegram-group-admins-sync branch October 26, 2026 22:07
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