Stage 9: Telegram integration (connector, Mini App, out-of-app push) #10

Merged
developer merged 1 commits from feature/stage-9-telegram into master 2026-06-04 05:12:54 +00:00
Owner

Stage 9 — Telegram integration.

Connector (platform/telegram, own container, bot token only there): go-telegram/bot long-poll (/start deep-links + Mini App launch button); gRPC API pkg/proto/telegram/v1 (ValidateInitData, Notify, SendToUser/SendToGameChannel — admin, wired Stage 10); test-env Bot API override; Dockerfile + compose (VPN sidecar).

Gateway: initData validation relocated into the connector (token dropped, internal/auth deleted), called over gRPC (GATEWAY_CONNECTOR_ADDR); out-of-app push routed for offline recipients via /internal/push-target + the in-app-only flag (race-free de-dup).

Backend: migration 00007 notifications_in_app_only (default true); Telegram language/display-name seeding on first contact; /internal/push-target.

UI: Mini App launch/auth/theme, /telegram/ guard, deep-link routing (g/i/f), authTelegram, in-app-only profile toggle, share-to-Telegram link. Vitest + Playwright.

Verified locally: gofmt/vet/build/test across backend+pkg+gateway+platform; backend integration tests; UI check/unit/build (86 KB gzip)/e2e (chromium + webkit); connector docker build.

Stage 9 — Telegram integration. **Connector** (`platform/telegram`, own container, bot token only there): go-telegram/bot long-poll (`/start` deep-links + Mini App launch button); gRPC API `pkg/proto/telegram/v1` (`ValidateInitData`, `Notify`, `SendToUser`/`SendToGameChannel` — admin, wired Stage 10); test-env Bot API override; Dockerfile + compose (VPN sidecar). **Gateway**: initData validation relocated into the connector (token dropped, `internal/auth` deleted), called over gRPC (`GATEWAY_CONNECTOR_ADDR`); out-of-app push routed for offline recipients via `/internal/push-target` + the in-app-only flag (race-free de-dup). **Backend**: migration `00007` `notifications_in_app_only` (default true); Telegram language/display-name seeding on first contact; `/internal/push-target`. **UI**: Mini App launch/auth/theme, `/telegram/` guard, deep-link routing (g/i/f), `authTelegram`, in-app-only profile toggle, share-to-Telegram link. Vitest + Playwright. Verified locally: gofmt/vet/build/test across backend+pkg+gateway+platform; backend integration tests; UI check/unit/build (86 KB gzip)/e2e (chromium + webkit); connector `docker build`.
developer force-pushed feature/stage-9-telegram from 5290157999 to 3590df28db 2026-06-03 23:48:40 +00:00 Compare
developer force-pushed feature/stage-9-telegram from 3590df28db to 9814d78ae3 2026-06-04 05:05:01 +00:00 Compare
developer added 1 commit 2026-06-04 05:10:22 +00:00
Stage 9: Telegram integration (connector side-service, Mini App, out-of-app push)
Tests · Go / test (push) Successful in 7s
Tests · Integration / integration (push) Successful in 12s
Tests · Go / test (pull_request) Successful in 6s
Tests · Integration / integration (pull_request) Successful in 11s
Tests · UI / test (pull_request) Successful in 19s
cf66ed7e26
New platform/telegram connector (own container, bot token only there):
- go-telegram/bot long-poll loop: /start deep-links + Mini App launch button.
- gRPC API pkg/proto/telegram/v1 (Telegram service): ValidateInitData, Notify
  (renders a localized message + deep-link button), SendToUser/SendToGameChannel
  (admin, wired in Stage 10). Generic methods are platform-agnostic (external_id).
- Bot API base override for Telegram's test environment; Dockerfile + compose
  (VPN sidecar, no public ingress); README.

Gateway:
- initData validation relocated from the gateway into the connector; the gateway
  calls ValidateInitData over gRPC (GATEWAY_CONNECTOR_ADDR), drops the bot token,
  and deletes internal/auth.
- Out-of-app push: runPushPump routes events whose recipient has no live in-app
  stream to connector.Notify, gated by /internal/push-target + the in-app-only
  flag (race-free de-dup); HasSubscribers added to the push hub.

Backend:
- Migration 00007 accounts.notifications_in_app_only (default true) + jetgen.
- ProvisionTelegram seeds a new account's language/display name from the launch
  fields; IdentityExternalID reverse lookup; /internal/push-target handler.

UI:
- Telegram Mini App launch: detect initData, apply themeParams, authTelegram,
  route the deep-link start_param (g/i/f); /telegram/ guard redirects outside
  Telegram. Vite relative base + telegram-web-app.js. In-app-only profile toggle;
  share-to-Telegram link for a friend code. Vitest + Playwright coverage.

Wire/docs/CI: fbs Profile/UpdateProfileRequest gain notifications_in_app_only
(Go + TS); go.work uses ./platform/telegram; go-unit.yaml covers it; PLAN,
ARCHITECTURE, FUNCTIONAL (+ru), UI_DESIGN, READMEs updated.
developer force-pushed feature/stage-9-telegram from 9814d78ae3 to cf66ed7e26 2026-06-04 05:10:22 +00:00 Compare
developer merged commit 4c4beace85 into master 2026-06-04 05:12:54 +00:00
developer deleted branch feature/stage-9-telegram 2026-06-04 05:12:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#10