Add dispose function for proper disabling of tracking #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Executing init with an empty key string leads to the following warning
Tracking will be disabled.
However, this tracking is only deactivated if there is no previously initialized tracking object.
Otherwise, the old one will continue to be used, although the warning promises that tracking is now disabled.
Specifically, we use it to deactivate tracking as a user option during the app runtime. The console warning implies that tracking is now also off, but the network logs showed that it was not actually deactivated. Thus, it poses an active risk of violating privacy.
This PR fixes this problem by actually stopping the polling in addition and overwriting the old client with undefined.