Notification and push architecture
AppKernia does not send to every device inside an HTTP request. The server uses PostgreSQL + River for asynchronous jobs and commits the notification, run record, and queued job in the same database transaction.
The pipeline serves Admin publishing, trusted service submissions, and Mobile in-app notifications. In-app delivery is the baseline: it remains available when a user disables push, a device has no supported provider, or a provider delivery fails.
End-to-end data flow
The synchronous request performs trusted validation and commits a transaction. Workers publish, fan out to devices, and call providers asynchronously. Business facts and jobs share PostgreSQL to avoid partial dual writes.
Three notification jobs
All three use the notifications queue. Business modules depend on platform/jobqueue, not on the River Client. Task kind, queue, maximum attempts, timeout, and automatically retryable classes are registered at compile time.
Sources of truth
Task projections never store River Args, full stacks, tokens, payloads, secrets, or raw provider responses. Use the Trace ID from a safe summary to investigate the full trace in the deployment's observability stack.
Delivery result semantics
Workers safely no-op when a notification has been cancelled or expired, or when a duplicate job arrives. An operator retry creates a new task linked to the original instead of rewriting River history.
Security boundaries
- A global kill switch, app/environment channel state, user subscription, and OS permission all gate push delivery.
- Tokens are encrypted and deduplicated with an HMAC hash. Credentials are write-only and encrypted; Admin APIs never return plaintext.
- A notification-open payload permits only a schema version, delivery/message IDs, a controlled
route_key, an opaque resource ID, and bounded route parameters. - Arbitrary URLs, component names, dynamic scripts, silent wake-up, and arbitrary background execution are unsupported.
- Prometheus labels use low-cardinality dimensions such as App, Provider, Category, and Result—never user IDs or tokens.
Acceptance boundary
A mock provider, source compilation, or provider acceptance does not prove a real device displayed a notification. Before production enablement, validate each provider's account entitlement, credentials, package or bundle identity, signing fingerprint, privacy/network behavior, and foreground, background, terminated, offline-recovery, and notification-open behavior on physical devices.
Continue with Push channel configuration, Notification operations, Notification API, and the Mobile permission center.