Skip to content

Auto-subscribe new accounts to configured channels - #183

Merged
iamxvbaba merged 1 commit into
iamxvbaba:mainfrom
kirforsi:autosubscribe
Nov 20, 2026
Merged

iamxvbaba merged 1 commit into
iamxvbaba:mainfrom
kirforsi:autosubscribe

Conversation

@kirforsi

Copy link
Copy Markdown
Contributor

Adds auto-join of newly registered accounts to a configurable list of channels.

  • TELESRV_AUTOSUBSCRIBE_CHANNELS: channel ids joined on registration (best effort, never fails signup)
  • cmd/subscribebackfill, scripts/subscribe.sh, scripts/fixsubscribe.sh: join existing accounts
  • setup.sh: one-command setup (Go, Postgres, Redis, build, .env, migrations, channels)
  • Unit test for the registration hook

Known limitation: subscribebackfill assigns message ids through the Postgres
allocator, not the Redis counter the server uses. fixsubscribe.sh re-syncs
counter:channel_msg_id:{id} after each run. Avoid running the backfill while
the channel is under heavy write load.

Tested on a live deployment: new registrations join the configured channel.

@iamxvbaba
iamxvbaba merged commit 3e04d96 into iamxvbaba:main Nov 20, 2026
4 checks passed
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.

2 participants