feat(telemetry): opt-in admin alert pushes

- telemetryAlerts metadata flag, admin-gated server fn
- alerts sent only to admins with the flag enabled
- settings toggle visible to admins only, under device notifications
This commit is contained in:
2026-08-25 23:33:01 -07:00
parent 1ddcffc511
commit 3d8ee52a15
8 changed files with 200 additions and 85 deletions
+33 -21
View File
@@ -105,7 +105,7 @@ msgid "{0} Badge Holders"
msgstr "{0} Badge Holders"
#. placeholder {0}: recentErrors.totalItems
#: src/lib/telemetry/alerts.server.ts:104
#: src/lib/telemetry/alerts.server.ts:110
msgid "{0} client errors in the last 15 minutes"
msgstr "{0} client errors in the last 15 minutes"
@@ -167,7 +167,7 @@ msgstr "{count, plural, one {Players (#)} other {Players (#)}}"
msgid "{count, plural, one {Teams (#)} other {Teams (#)}}"
msgstr "{count, plural, one {Teams (#)} other {Teams (#)}}"
#: src/lib/telemetry/alerts.server.ts:167
#: src/lib/telemetry/alerts.server.ts:173
msgid "{deniedCount} denied admin access attempts in the last 15 minutes"
msgstr "{deniedCount} denied admin access attempts in the last 15 minutes"
@@ -206,7 +206,7 @@ msgstr "{n, plural, one {# match guaranteed} other {# matches guaranteed}}"
msgid "{n, plural, one {# wildcard} other {# wildcards}}"
msgstr "{n, plural, one {# wildcard} other {# wildcards}}"
#: src/lib/telemetry/alerts.server.ts:154
#: src/lib/telemetry/alerts.server.ts:160
msgid "{name} failed {count} times in the last 15 minutes"
msgstr "{name} failed {count} times in the last 15 minutes"
@@ -392,7 +392,7 @@ msgid "A code was sent to +1 ({0}) {1}-{2}"
msgstr "A code was sent to +1 ({0}) {1}-{2}"
#. placeholder {0}: info.message.slice(0, 120)
#: src/lib/telemetry/alerts.server.ts:125
#: src/lib/telemetry/alerts.server.ts:131
msgid "A new error appeared: {0}"
msgstr "A new error appeared: {0}"
@@ -718,7 +718,7 @@ msgstr "Claymation"
msgid "Clear selected player"
msgstr "Clear selected player"
#: src/lib/telemetry/alerts.server.ts:103
#: src/lib/telemetry/alerts.server.ts:109
msgid "Client error spike"
msgstr "Client error spike"
@@ -813,18 +813,22 @@ msgstr "Copy phone number"
msgid "Correct picks are worth more each round"
msgstr "Correct picks are worth more each round"
#: src/features/settings/components/notifications-section.tsx:43
#: src/features/settings/components/notifications-section.tsx:78
msgid "Couldn't disable notifications"
msgstr "Couldn't disable notifications"
#: src/features/settings/components/notifications-section.tsx:38
#: src/features/settings/components/notifications-section.tsx:73
msgid "Couldn't enable notifications"
msgstr "Couldn't enable notifications"
#: src/features/settings/components/notifications-section.tsx:50
#: src/features/settings/components/notifications-section.tsx:85
msgid "Couldn't send test notification"
msgstr "Couldn't send test notification"
#: src/features/settings/components/notifications-section.tsx:23
msgid "Couldn't update telemetry alerts"
msgstr "Couldn't update telemetry alerts"
#: src/features/reactions/components/emoji-picker.tsx:17
msgid "crane"
msgstr "crane"
@@ -904,7 +908,7 @@ msgstr "Deep Sea"
msgid "Default"
msgstr "Default"
#: src/lib/telemetry/alerts.server.ts:166
#: src/lib/telemetry/alerts.server.ts:172
msgid "Denied access attempt"
msgstr "Denied access attempt"
@@ -985,7 +989,7 @@ msgstr "Edit Tournament"
msgid "Edit Your Prediction"
msgstr "Edit Your Prediction"
#: src/features/settings/components/notifications-section.tsx:65
#: src/features/settings/components/notifications-section.tsx:100
msgid "Enable notifications on this device"
msgstr "Enable notifications on this device"
@@ -1097,6 +1101,10 @@ msgstr "Error group resolved"
msgid "Error Message"
msgstr "Error Message"
#: src/features/settings/components/notifications-section.tsx:35
msgid "Error spikes and failing functions, pushed to this account"
msgstr "Error spikes and failing functions, pushed to this account"
#: src/components/DefaultCatchBoundary.tsx:98
msgid "Error: {errorMessage}"
msgstr "Error: {errorMessage}"
@@ -1679,7 +1687,7 @@ msgstr "Never"
msgid "Never active"
msgstr "Never active"
#: src/lib/telemetry/alerts.server.ts:124
#: src/lib/telemetry/alerts.server.ts:130
msgid "New client error"
msgstr "New client error"
@@ -1834,24 +1842,24 @@ msgstr "Not right"
msgid "Not right — enter our score"
msgstr "Not right — enter our score"
#: src/features/settings/components/notifications-section.tsx:18
#: src/features/settings/components/notifications-section.tsx:59
#: src/features/settings/components/notifications-section.tsx:53
#: src/features/settings/components/notifications-section.tsx:94
msgid "Notifications"
msgstr "Notifications"
#: src/features/settings/components/notifications-section.tsx:35
#: src/features/settings/components/notifications-section.tsx:70
msgid "Notifications are blocked. Enable them in your browser settings."
msgstr "Notifications are blocked. Enable them in your browser settings."
#: src/features/settings/components/notifications-section.tsx:21
#: src/features/settings/components/notifications-section.tsx:56
msgid "Notifications aren't available right now."
msgstr "Notifications aren't available right now."
#: src/features/settings/components/notifications-section.tsx:42
#: src/features/settings/components/notifications-section.tsx:77
msgid "Notifications disabled on this device"
msgstr "Notifications disabled on this device"
#: src/features/settings/components/notifications-section.tsx:32
#: src/features/settings/components/notifications-section.tsx:67
msgid "Notifications enabled on this device"
msgstr "Notifications enabled on this device"
@@ -2304,7 +2312,7 @@ msgstr "Select your walkout song"
msgid "Send Code"
msgstr "Send Code"
#: src/features/settings/components/notifications-section.tsx:75
#: src/features/settings/components/notifications-section.tsx:111
msgid "Send test notification"
msgstr "Send test notification"
@@ -2313,7 +2321,7 @@ msgstr "Send test notification"
msgid "Series is tied"
msgstr "Series is tied"
#: src/lib/telemetry/alerts.server.ts:153
#: src/lib/telemetry/alerts.server.ts:159
msgid "Server function failing"
msgstr "Server function failing"
@@ -2579,6 +2587,10 @@ msgstr "Teams created successfully!"
msgid "Telemetry"
msgstr "Telemetry"
#: src/features/settings/components/notifications-section.tsx:34
msgid "Telemetry alerts"
msgstr "Telemetry alerts"
#: src/themes/terminal/manifest.ts:6
msgid "Terminal"
msgstr "Terminal"
@@ -2587,7 +2599,7 @@ msgstr "Terminal"
msgid "Test notification — push is working on this device."
msgstr "Test notification — push is working on this device."
#: src/features/settings/components/notifications-section.tsx:49
#: src/features/settings/components/notifications-section.tsx:84
msgid "Test notification sent"
msgstr "Test notification sent"
@@ -2620,7 +2632,7 @@ msgstr "These players have not faced each other yet."
msgid "These teams have not faced each other yet."
msgstr "These teams have not faced each other yet."
#: src/features/settings/components/notifications-section.tsx:22
#: src/features/settings/components/notifications-section.tsx:57
msgid "This device doesn't support push notifications. On iOS, install the app to your Home Screen first."
msgstr "This device doesn't support push notifications. On iOS, install the app to your Home Screen first."