Repository navigation
feat(telegram): add demo session refresh CronJob - #334
Conversation
The demo/reviewer Telegram session row is subject to the normal session TTLs (absolute 90d, idle 30d) and revoke-on-disconnect. On 2026-05-30 a short 24h expires_at lapsed and the absolute-TTL sweeper revoked the only row, leaving CheckSessionValid with no active session -> reviewers hit "Sign-in interrupted: no active Telegram session" at tg.mctl.ai. Add a daily CronJob (via base-service extraObjects) that un-revokes the newest demo session row and pushes expires_at/last_used_at out 90d while forcing send_enabled=false, so the reviewer login stays usable for the whole App Directory review window. Temporary: remove with DEMO_REVIEWER_ENABLED once the durable fix ships post-freeze (make the DEMO_REVIEWER_TG_ID identity immune to TTL sweeps, mirroring the evaluateSendGate reviewer override). image.tag unchanged (0.40.0) -- this is auxiliary infra, not a release.
|
Claude finished @mashkovd's task in 2m 18s —— View job Review: demo session refresh CronJob
FindingsCorrectness — verified OK
P3 (non-blocking)
The VerdictP1: 0 · P2: 0 · P3: 2 — No P1/P2 findings, good to merge. |
| imagePullSecrets: | ||
| - name: ghcr-credentials |
There was a problem hiding this comment.
P3 — postgres:17-alpine is pulled from public Docker Hub, so the ghcr-credentials imagePullSecret is unnecessary here (the chart's dbInitJob references it because it can run app images from GHCR). Harmless, but you can drop it to avoid implying a GHCR dependency.
| - name: refresh | ||
| image: postgres:17-alpine |
There was a problem hiding this comment.
P3 — The container sets no resources or securityContext. The labs LimitRange provides default/defaultRequest, so the pod will still admit under the namespace ResourceQuota (no blocker), and this mirrors the existing dbInitJob. Optional hardening for a long-lived CronJob: add small explicit requests/limits and a securityContext (runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false).
postgres:17-alpine is a public Docker Hub image; the ghcr-credentials secret is only relevant to GHCR app images (as in dbInitJob). Addresses the P3 review nit on PR #334.
|
Claude finished @mashkovd's task in 1m 10s —— View job Re-review: demo session refresh CronJob (after sync)
What changed since last reviewThe latest commit ( Findings — still clean
Remaining (non-blocking, P3)
VerdictP1: 0 · P2: 0 · P3: 1 — No P1/P2 findings, good to merge. |
What
Adds a daily CronJob (
labs-mctl-telegram-demo-session-refresh) via the base-serviceextraObjectshook that keeps the ChatGPT App Directory demo/reviewer Telegram session row perpetually fresh.Why
On 2026-05-30 the reviewer login at tg.mctl.ai dead-ended with "Sign-in interrupted — The demo account has no active Telegram session."
Root cause (confirmed via DB + audit chain, not a reviewer disconnect): the newest
telegram_accountsrow for the demo account (8745115872/users.id 6462) hadexpires_at = connected_at + 24h(artifact of a manual re-seed), while every other row had the normal+90d. The 24h TTL lapsed and the automatic absolute-TTL sweeper (SweepAbsoluteSessions/CheckSessionValid) revoked the only row (~30 min after expiry, no audit entry). With no non-revoked row,CheckSessionValidreturnsErrNoActiveSessionanddemo_login.gorenders the error page.The session was restored manually (un-revoke + 90d TTL; verified live with a real
list_dialogs). This CronJob prevents recurrence during the review window.How
schedule: 17 3 * * *(daily, off-peak UTC).expires_at/last_used_atout 90d, forcessend_enabled=false.postgres:17-alpine+ the existinglabs-mctl-telegram-db-credssecret (same pattern as the chart'sdbInitJob).users.telegram_login_id = '8745115872'(robust to new row ids).Scope / safety
image.tagunchanged (0.40.0) — auxiliary infra, not a mctl-telegram release; the 0.40.0 freeze is respected.mctl-telegram-loginre-seed is still required.DEMO_REVIEWER_ENABLEDonce the durable fix ships post-freeze (make theDEMO_REVIEWER_TG_IDidentity immune to TTL sweeps, mirroring theevaluateSendGatereviewer override).Validation
helm templaterenders the CronJob cleanly; app Deployment/image unchanged.