mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(analytics): harden analytics opt-out and feedback surfaces (#423)
Server stops phoning Sentry home after opt-out (release-health sessions + client reports off); settings saves diff-send only changed keys so a stale tab cannot revert an instance-wide opt-out; disabling analytics hides the feedback UI immediately; optIn resumes PostHog after re-enable; onboarding survey writes time out at 15s; inline tool-feedback prompt arms a shown-cooldown.
This commit is contained in:
@@ -27,6 +27,11 @@ if (ANALYTICS_BAKED.sentryDsn) {
|
||||
environment: process.env.NODE_ENV || "production",
|
||||
tracesSampleRate: ANALYTICS_BAKED.sampleRate,
|
||||
sendDefaultPii: false,
|
||||
// Release-health request-sessions and client-report envelopes are sent outside
|
||||
// beforeSend/beforeSendTransaction, so the runtime opt-out below would not stop
|
||||
// them. Disable both so an opted-out instance truly stops phoning home.
|
||||
integrations: [Sentry.httpIntegration({ trackIncomingRequestsAsSessions: false })],
|
||||
sendClientReports: false,
|
||||
// Runtime opt-out: drop the whole transaction when analytics is off.
|
||||
tracesSampler: () => (sentryActive() ? ANALYTICS_BAKED.sampleRate : 0),
|
||||
beforeSend(event) {
|
||||
|
||||
Reference in New Issue
Block a user