feat: Sentry panic alerts - #161
Draft
JordiMa wants to merge 3 commits into
Draft
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Implementation notes
panicalert type, shown distinctly on Telegram, push, and the in-app history (FR/EN) —resolveAlertTextsstays an exhaustiveRecord<AlertEventType, …>, so a missing type is a compile error.panicvalue toalert_events_type_enum.Tests