Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some signals get sent even with analyticsDisabled config option #209

Closed
daprice opened this issue Nov 30, 2024 · 2 comments · Fixed by #211
Closed

Some signals get sent even with analyticsDisabled config option #209

daprice opened this issue Nov 30, 2024 · 2 comments · Fixed by #211

Comments

@daprice
Copy link

daprice commented Nov 30, 2024

If, in a SwiftUI lifecycle app, I add the following in the init() of the App

var config = TelemetryDeck.Config(appID: “redacted")
config.analyticsDisabled = true
TelemetryDeck.initialize(config: config)

I still occasionally see log messages like "Sending 1 signals leaving a cache of 0 signals”. It looks like this config option does avoid sending any signals when I call TelemetryDeck.signal(…). However, signals from TelemetryDeck.errorOccurred(…) and the internal TelemetryDeck.Session.started signal are still sent and show up on TelemetryDeck’s Recent Signals page.

My use case is that I have a toggle in my settings screen for users to opt out of analytics. Initializing TelemetryDeck with Config.analyticsDisabled seemed like an appropriate way to honor this without having to add a check everywhere that I send a signal.

Workaround

As an easy workaround, I just made a wrapper around TelemetryDeck that avoids calling TelemetryDeck.initialize(), .signal(…) or .errorOccurred(…) if it should be disabled.

@Jeehut
Copy link
Contributor

Jeehut commented Dec 1, 2024

@daprice Thank you for reporting this! I'm sorry for introducing this issue, it's an oversight in some internal restructuring. But I just fixed it in #211 which should be merged and released in the next version soon!

@Jeehut
Copy link
Contributor

Jeehut commented Dec 2, 2024

@daprice I'm happy to inform you that the fix is now part of the new SDK release 2.6.0.

Please give it a try and let me know if you run into any issues! Thank you again for reporting this. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants