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

Can't disable Insights #290

Open
jwells89 opened this issue May 26, 2023 · 2 comments
Open

Can't disable Insights #290

jwells89 opened this issue May 26, 2023 · 2 comments
Assignees

Comments

@jwells89
Copy link

jwells89 commented May 26, 2023

Describe the bug 🐛
At least when instantsearch-core is added to a project with the SPM package via Xcode, there doesn't seem to be a functional way of disabling Insights. I couldn't find any documentation on the topic, and the two places I found seemingly relevant functionality (Insights.shared?.isActive and HitsSearcher.eventTracker.isEnabled) don't change anything when set to false — in the Xcode console I still see messages like, "[InstantSearchInsights] sending events package".

To Reproduce 🔍
Steps to reproduce the behavior:

  1. Disable Insights globally with Insights.shared?.isActive = false
  2. Disable Insights for a HitsSearcher with searcher.eventTracker.isEnabled = false
  3. Observe Insights continuing to be sent

Expected behavior 💭
Insights shouldn't do anything after it's been disabled.

Environment:

  • OS: iOS
  • Version iOS 16.5, InstantSearch 7.25.0
@VladislavFitz
Copy link
Contributor

Hi @jwells89 ,
Thank you for reporting this. I'll investigate this issue and come back with a patch.

@VladislavFitz
Copy link
Contributor

Hi @jwells89,
I examined the behavior of automatic event sending when searcher.eventTracker.isEnabled is set to false, and it functions as intended by preventing the capture of new events. The events you observe in the logs might occur because of events that were already stored in memory before disabling event tracking. These events could have been captured during previous app sessions since they are stored persistently in the device's memory.

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

No branches or pull requests

2 participants