Skip to content

Sentry telemetry is initialised before any consent setting is read #949

Description

@gmipf

SentrySdk.Init runs unconditionally at Aaru/Main.cs:85 — about 190 lines before the consent check at :279, and no setting gates it. Crash reporting is a reasonable thing to want, and self-hosting it is the considerate way to do it; the issue is only that it currently runs before the user can say anything about it.

I package Aaru for several distros, which is how I noticed. Measured on 6.0.0-beta.1:

  • A plain aaru --version sends a session event with "errors":0 — so this reports fine starts, not just crashes. It carries a did that stayed identical across separate runs (persisted in ~/.local/share/Sentry/<hash>/.installation), so it links an installation over time.

  • With a fresh $HOME, data goes out on the very first run, and the config written that same run says "GdprCompliance": 0.

  • That first run also sends an exception report — carrying the command line (SetExtra("Args", …), Main.cs:109):

    "value":"Failed to read input in non-interactive mode."
    "Args":["/usr/lib64/aaru/aaru","--version"]
    

    The exception is the consent wizard failing without a TTY. For a disc-imaging tool those arguments routinely name device and output paths.

  • There is no opt-out. The DSN is hardcoded at :90, so SENTRY_DSN has no effect. Telemetry is not mentioned in the README or offered in configure.

It looks unintended rather than deliberate: the block is the Sentry quickstart sample, comments included ("You shouldn't do this in your applications unless you're troubleshooting"), TracesSampleRate = 1.0 is the sample value, and Aaru.Settings/Settings.cs — the class managing the consent flags — reports its own exceptions to Sentry.

Suggested fix: gating the single Init call is probably enough, since without it every CaptureException in the codebase becomes a no-op and no call site needs touching. That means reading settings before Sentry and initialising only when a flag allows — an existing one like ShareReports, or a new one alongside the other StatsSettings so configure can ask for it. Honouring SENTRY_DSN when already set would be a useful one-liner regardless.

Happy to open a PR for whichever shape you prefer — I didn't send one straight away because which flag should govern this is your call.

Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions