[No QA] feat: add Sentry debug controls to Troubleshoot page#77254
Conversation
Add UI controls to enable/disable Sentry debug logging at runtime without code changes. Previously debugging Sentry required modifying constants in debugTransport.ts and rebuilding the app. Changes: - Add SentryDebugToolMenu component with toggle and span filter input - Store debug settings in Onyx (IS_SENTRY_DEBUG_ENABLED, SENTRY_DEBUG_HIGHLIGHTED_SPAN_OPS) - Update debugTransport to read settings from Onyx instead of hardcoded constants - Remove early return in telemetry/index.ts so Sentry initializes in dev mode - Show Sentry debug section only in development environment
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Prevents infinite logging loop by filtering log entries with [SENTRY] prefix from Sentry envelopes before outputting to console. Also skips envelopes that contain only headers after filtering.
Code Review Complete ✅I've reviewed all the code changes in this PR and found no rule violations. The implementation looks good: Key Observations:
The PR successfully adds runtime Sentry debug controls without requiring code changes or rebuilds. Nice work! 🎉 |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index aec47d69..c495b318 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1927,6 +1927,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Fehlerdaten aufzeichnen',
softKillTheApp: 'App sanft beenden',
kill: 'Beenden',
+ sentryDebug: 'Sentry-Debug',
+ sentryDebugDescription: 'Sentry-Anfragen in der Konsole protokollieren',
+ sentryHighlightedSpanOps: 'Hervorgehobene Bereichsnamen',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, Navigation, ui.load',
},
debugConsole: {
saveLog: 'Protokoll speichern',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index edf8bcb9..5f720aac 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1927,6 +1927,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Enregistrer les données de dépannage',
softKillTheApp: 'Fermer l’application en douceur',
kill: 'Tuer',
+ sentryDebug: 'Débogage Sentry',
+ sentryDebugDescription: 'Consigner les requêtes Sentry dans la console',
+ sentryHighlightedSpanOps: 'Noms de segments surlignés',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.clic, navigation, ui.chargement',
},
debugConsole: {
saveLog: 'Enregistrer le journal',
@@ -6239,7 +6243,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
autoPayReportsUnderTitle: 'Rapports de paiement automatique sous',
autoPayReportsUnderDescription: 'Les notes de frais entièrement conformes en dessous de ce montant seront automatiquement réglées.',
unlockFeatureEnableWorkflowsSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
- `Allez dans [plus de fonctionnalités](${moreFeaturesLink}) et activez les workflows, puis ajoutez ${featureName} pour déverrouiller cette fonctionnalité.`,
+ `Accédez à [plus de fonctionnalités](${moreFeaturesLink}) et activez les workflows, puis ajoutez ${featureName} pour déverrouiller cette fonctionnalité.`,
enableFeatureSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
`Allez dans [plus de fonctionnalités](${moreFeaturesLink}) et activez ${featureName} pour déverrouiller cette fonctionnalité.`,
},
diff --git a/src/languages/it.ts b/src/languages/it.ts
index d7642a8d..e6520b4c 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1922,6 +1922,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Registrare dati di risoluzione problemi',
softKillTheApp: "Termina l'app in modo non forzato",
kill: 'Termina',
+ sentryDebug: 'Debug di Sentry',
+ sentryDebugDescription: 'Registra le richieste Sentry nella console',
+ sentryHighlightedSpanOps: 'Nomi degli span evidenziati',
+ sentryHighlightedSpanOpsPlaceholder: 'clic.interazione.ui, navigazione, caricamento.ui',
},
debugConsole: {
saveLog: 'Salva registro',
@@ -6210,7 +6214,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
autoPayReportsUnderTitle: 'Pagamento automatico dei report inferiori a',
autoPayReportsUnderDescription: 'Le note spese completamente conformi inferiori a questo importo verranno rimborsate automaticamente.',
unlockFeatureEnableWorkflowsSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
- `Vai a [altre funzionalità](${moreFeaturesLink}) e abilita i flussi di lavoro, quindi aggiungi ${featureName} per sbloccare questa funzionalità.`,
+ `Vai su [altre funzionalità](${moreFeaturesLink}) e abilita i flussi di lavoro, quindi aggiungi ${featureName} per sbloccare questa funzionalità.`,
enableFeatureSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
`Vai a [altre funzionalità](${moreFeaturesLink}) e abilita ${featureName} per sbloccare questa funzione.`,
},
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index dcea62da..b526ad4a 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1922,6 +1922,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'トラブルシュートデータを記録',
softKillTheApp: 'アプリをソフト終了する',
kill: '強制終了',
+ sentryDebug: 'Sentry デバッグ',
+ sentryDebugDescription: 'Sentry リクエストをコンソールに記録',
+ sentryHighlightedSpanOps: 'ハイライト表示されたスパン名',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, ナビゲーション, ui.load',
},
debugConsole: {
saveLog: 'ログを保存',
@@ -6156,7 +6160,7 @@ ${reportName}
adultEntertainment: 'アダルトエンターテインメント',
},
expenseReportRules: {
- title: '経費精算書',
+ title: '経費レポート',
subtitle: '経費精算レポートのコンプライアンス、承認、支払いを自動化します。',
preventSelfApprovalsTitle: '自己承認を防ぐ',
preventSelfApprovalsSubtitle: 'ワークスペースメンバーが自分自身の経費精算レポートを承認できないようにします。',
@@ -6173,7 +6177,7 @@ ${reportName}
autoPayReportsUnderTitle: '以下のレポートを自動支払い',
autoPayReportsUnderDescription: 'この金額以下の、要件を完全に満たした経費精算書は自動的に支払われます。',
unlockFeatureEnableWorkflowsSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
- `[その他の機能](${moreFeaturesLink}) に移動してワークフローを有効にし、その後 ${featureName} を追加してこの機能を有効化してください。`,
+ `[その他の機能](${moreFeaturesLink}) に移動してワークフローを有効にし、その後 ${featureName} を追加してこの機能を有効にしてください。`,
enableFeatureSubtitle: ({featureName, moreFeaturesLink}: FeatureNameParams) =>
`[その他の機能](${moreFeaturesLink})に移動し、${featureName} を有効にしてこの機能をアンロックしてください。`,
},
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 036c1bfb..4df13fd8 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1920,6 +1920,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Gegevens voor probleemoplossing vastleggen',
softKillTheApp: 'De app zacht afsluiten',
kill: 'Beëindigen',
+ sentryDebug: 'Sentry-debug',
+ sentryDebugDescription: 'Sentry-aanvragen naar console loggen',
+ sentryHighlightedSpanOps: 'Gemarkeerde spannamen',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interactie.klik, navigatie, ui.laden',
},
debugConsole: {
saveLog: 'Log opslaan',
@@ -6181,7 +6185,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
adultEntertainment: 'Volwassenenentertainment',
},
expenseReportRules: {
- title: 'Onkostendeclaraties',
+ title: 'Declaraties',
subtitle: 'Automatiseer naleving, goedkeuringen en betalingen van onkostendeclaraties.',
preventSelfApprovalsTitle: 'Zelfgoedkeuringen voorkomen',
preventSelfApprovalsSubtitle: 'Voorkom dat werkruimtedeelnemers hun eigen onkostendeclaraties goedkeuren.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index d2d43c9a..bd1daaf7 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1918,6 +1918,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Rejestruj dane diagnostyczne',
softKillTheApp: 'Delikatnie zakończ działanie aplikacji',
kill: 'Zakończ',
+ sentryDebug: 'Debugowanie Sentry',
+ sentryDebugDescription: 'Rejestruj żądania Sentry w konsoli',
+ sentryHighlightedSpanOps: 'Nazwy podświetlonych fragmentów',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, nawigacja, ui.load',
},
debugConsole: {
saveLog: 'Zapisz log',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 4010d47c..22205cc7 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1917,6 +1917,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: 'Registrar Dados de Solução de Problemas',
softKillTheApp: 'Encerrar o aplicativo sem forçar',
kill: 'Encerrar',
+ sentryDebug: 'Depuração do Sentry',
+ sentryDebugDescription: 'Registrar solicitações do Sentry no console',
+ sentryHighlightedSpanOps: 'Nomes de trechos destacados',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, navegação, ui.load',
},
debugConsole: {
saveLog: 'Salvar log',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 8ee1d32a..ed0594ca 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1892,6 +1892,10 @@ const translations: TranslationDeepObject<typeof en> = {
recordTroubleshootData: '记录故障排查数据',
softKillTheApp: '软关闭应用',
kill: '终止',
+ sentryDebug: 'Sentry 调试',
+ sentryDebugDescription: '将 Sentry 请求记录到控制台',
+ sentryHighlightedSpanOps: '高亮显示的跨度名称',
+ sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, 导航, ui.load',
},
debugConsole: {
saveLog: '保存日志',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
@dariusz-biela Please take a look at the failing checks |
Add sentryDebug, sentryDebugDescription sentryHighlightedSpanOps translations for de, fr, it, ja, nl, pl, pt-BR, zh-hans. Placeholder kept identical across all languages as it contains technical span operation names.
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required. Unsubscribing.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-15.at.10.52.02.mp4Android: mWeb ChromeScreen.Recording.2025-12-15.at.10.53.00.mp4iOS: HybridAppScreen.Recording.2025-12-15.at.10.55.33.mp4iOS: mWeb SafariScreen.Recording.2025-12-15.at.11.17.54.mp4MacOS: Chrome / SafariScreen.Recording.2025-12-15.at.10.47.44.mp4 |
|
@JmillsExpensify Do we need to add the Screen.Recording.2025-12-15.at.10.30.53.mov |
@dariusz-biela Could you post a Slack message to confirm the translation and share the Slack link? |
@huult This UI will never be displayed to a normal user and is only available in the development environment. I treated adding translations more as a way to satisfy eslint and typecheck. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.2.79-0 🚀
|
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.2.81-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀
|
Explanation of Change
Add UI controls to enable/disable Sentry debug logging at runtime without
code changes. Previously debugging Sentry required modifying constants in
debugTransport.ts and rebuilding the app.
Changes:
Fixed Issues
$ #76428
PROPOSAL:
Tests
navigation.processing[SENTRY]logs appear in the console[SENTRY]logs are not loopingOffline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2025-12-10.at.17.57.18.mov
Android: Native
iOS: Native