feat(reporting): add PII-free account summary to debug reports #245

Merged
JMR-dev merged 16 commits from feat-235-debug-report-accounts into main 2026-07-04 01:00:57 +00:00
JMR-dev commented 2026-07-03 17:54:03 +00:00 (Migrated from github.com)

Adds a PII-free account summary to the debug/problem report (issue #235): the number of accounts and, per account, the provider + auth type.

Change

  • DebugReport gains accounts: List<String> — one "<provider> (<authType>)" entry per account (e.g. "Outlook (OAUTH_OUTLOOK)", "Gmail (PASSWORD_IMAP)"); the count is the list size. Serialized as the report's "accounts" array.
  • DiagnosticsCollector derives the provider as a coarse bucket from the IMAP host — Gmail/Yahoo/iCloud/Outlook/AOL, else "Other". It never stores the raw host or email, so a custom mail domain buckets to "Other" and no PII leaks.
  • Accounts are cached like settings (warmed at startup, refreshed on manual report) so crash reports — built synchronously on the crashing thread — include the last-known snapshot. Accounts live in the non-auth AccountDatabase, so the read never blocks on the encrypted cache.
  • Recent logs were already captured (the RingLogBuffer → report "logs"), so that half of the ask was already satisfied.

Tests

  • DiagnosticsCollectorTest: summarizes 3 accounts to the expected labels and asserts no @/hostname leaks (a custom host → "Other").
  • CrashReporterTest updated for the new dependency.
  • Preflight green (build, unit tests, androidTest compile, lint, ktlint, detekt).

Closes #235

🤖 Generated with Claude Code

Adds a **PII-free account summary** to the debug/problem report (issue #235): the **number of accounts** and, per account, the **provider + auth type**. ## Change - `DebugReport` gains `accounts: List<String>` — one `"<provider> (<authType>)"` entry per account (e.g. `"Outlook (OAUTH_OUTLOOK)"`, `"Gmail (PASSWORD_IMAP)"`); the count is the list size. Serialized as the report's `"accounts"` array. - `DiagnosticsCollector` derives the **provider as a coarse bucket** from the IMAP host — Gmail/Yahoo/iCloud/Outlook/AOL, else **"Other"**. It never stores the raw host or email, so a custom mail domain buckets to "Other" and **no PII leaks**. - Accounts are cached like settings (warmed at startup, refreshed on manual report) so **crash reports** — built synchronously on the crashing thread — include the last-known snapshot. Accounts live in the non-auth `AccountDatabase`, so the read never blocks on the encrypted cache. - **Recent logs were already captured** (the `RingLogBuffer` → report `"logs"`), so that half of the ask was already satisfied. ## Tests - `DiagnosticsCollectorTest`: summarizes 3 accounts to the expected labels and asserts **no `@`/hostname leaks** (a custom host → "Other"). - `CrashReporterTest` updated for the new dependency. - Preflight green (build, unit tests, androidTest compile, lint, ktlint, detekt). Closes #235 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.