Repository navigation
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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
force-pushed
the
feat/telegram-group-admins-sync
branch
from
October 26, 2026 19:59
da0eae6 to
0a7185d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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():nullwhen no bot is connected or it doesn't answer within 3 seconds, so People pages don't hang on the bot.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, staysnull, 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 testwith 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.