Skip to content

feat: Sentry panic alerts - #161

Draft
JordiMa wants to merge 3 commits into
abarghoud:testingfrom
JordiMa:feat/sentry-presence-alerts
Draft

feat: Sentry panic alerts#161
JordiMa wants to merge 3 commits into
abarghoud:testingfrom
JordiMa:feat/sentry-presence-alerts

Conversation

@JordiMa

@JordiMa JordiMa commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a Panic security alert driven by the SentryMode telemetry stream (the proven, streamable signal): when Sentry escalates to "Panic" (the vehicle alarm is sounding), the owner gets a critical alert via Telegram, push, and the in-app history (FR/EN).

The existing immediate Sentry "Aware" alert (Warning) is kept unchanged.

Behaviour

Sentry "Aware"  -> Sentry alert (Warning)   [existing]
Sentry "Panic"  -> Panic alert  (Critical)  [new]

Implementation notes

  • New first-class panic alert type, shown distinctly on Telegram, push, and the in-app history (FR/EN) — resolveAlertTexts stays an exhaustive Record<AlertEventType, …>, so a missing type is a compile error.
  • Migration adds the panic value to alert_events_type_enum.

Tests

  • API: alerts / notifications / telegram specs green
  • Mobile: alert specs green
  • Type-clean & lint-clean on changed files

Alert the owner when the vehicle stays in Sentry "Aware" (someone lingering
around the vehicle) and when Sentry escalates to "Panic" (alarm), using the
SentryMode telemetry stream.

- Sustained presence: re-alerts every SENTRY_SUSTAINED_AWARE_SECONDS while Aware,
  capped at SENTRY_SUSTAINED_MAX_REPEATS, with a final "no more alerts for this
  incident" reminder; resets when the vehicle leaves Aware.
- New first-class alert types (sustained_presence, sustained_presence_final,
  panic) shown distinctly on Telegram, push, and the in-app history (FR/EN).
- Keeps the existing immediate Sentry alert on every Aware.
@JordiMa
JordiMa requested a review from abarghoud as a code owner June 18, 2026 17:56
@JordiMa
JordiMa marked this pull request as draft June 23, 2026 18:48
Drops the "someone is lingering" layer (presence tracker, alert types, Telegram/push/in-app texts, env vars, migration values) that produced false positives on transient passers-by. The base Sentry "Aware" alert and the "Panic" critical alert are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JordiMa JordiMa changed the title feat: Sentry sustained-presence & panic alerts feat: Sentry panic alerts Jun 24, 2026
@abarghoud
abarghoud deleted the branch abarghoud:testing July 2, 2026 10:31
@abarghoud abarghoud closed this Jul 2, 2026
@JordiMa JordiMa reopened this Jul 2, 2026
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