Skip to content

On-duty administrator ticket notifications

Open Petugas piket in the dashboard or mobile Menu. Save your personal WhatsApp number with country code in Anggota & akses (for example 62812…, digits only), then choose Mulai piket. Each administrator controls their own switch. All administrators start off duty. Choose Akhiri piket when finished; logging out does not end a shift.

New tickets and transitions back to open generate one alert per on-duty administrator per opening. Alerts contain the ticket ID, current priority, a sanitized requester name and short subject, and an authenticated dashboard link. Full descriptions and conversations are not sent. The dashboard link opens the specific ticket after login.

If nobody is on duty, new opening events remain available for catch-up when an administrator starts duty, provided the ticket is still open. Tickets already open before deployment are not backfilled. Priority edits or repeated source jobs do not create new opening alerts. Resolved, closed or in-progress tickets are skipped. Reopening creates a new alert cycle.

A profile phone change invalidates the current duty opt-in. Start duty again to confirm the new number. Inactive members, non-admin roles and disabled/deleted dashboard accounts cannot receive alerts. On-duty state is separate from dashboard login sessions and case takeover.

The ticket opening and its durable event are written in one database transaction. Rollback removes both. A background worker fans out to eligible on-duty admins, uniquely keyed by event and administrator. Duty, account, phone and current opening are checked again before sending. The existing send_whatsapp function uses private WAHA and records outbound message IDs, preserving native-human-reply echo suppression.

The worker checks WAHA session readiness before claiming a send. Offline sessions leave alerts pending, with a 30-second preflight backoff. Notifications have a shared five-second sending gap and run after human replies and before the next AI job. Long-running current AI jobs can delay alerts until their processing finishes.

A committed sending claim precedes external delivery. A timeout, failure or uncertain send result is marked unconfirmed and is not retried automatically. A claim left sending by a worker crash is marked unconfirmed after five minutes. This is an at-most-once automatic attempt, not an exactly-once network-delivery guarantee. Diterima WAHA means accepted by WAHA, not delivered/read by the human. Delivery history is shown in Petugas piket; continue monitoring ticket queues if WhatsApp is unavailable.

Admin duty endpoints use the same authenticated, admin-only, same-origin and CSRF protections as the dashboard. No credentials are exposed in alerts, source files or logs. WAHA remains unofficial and its account-restriction risk is unchanged.

Additive tables: admin_duty, ticket_open_events, ticket_notifications, ticket_notification_gate. The deployment includes app and database backups, disposable-database tests, mocked browser checks at 360/390/1440 pixels, an app-only restart and health/auth checks. Tests send no real WhatsApp messages and do not enable any production admin automatically.

Run isolated backend tests through compose.test.yaml. Browser check: python scripts/check_admin_duty_browser.py. Existing tests and production databases must remain separate. Rollback restores the prior app image/source; the additive tables can remain. Keep all admins off duty to stop these alerts without affecting normal member replies.