Skip to content

Zombie Analytics after deallocation. #159

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

Closed
frangrolemund opened this issue Oct 1, 2022 · 4 comments · Fixed by #164
Closed

Zombie Analytics after deallocation. #159

frangrolemund opened this issue Oct 1, 2022 · 4 comments · Fixed by #164
Assignees
Labels

Comments

@frangrolemund
Copy link

Describe the bug
Creating and deallocating the Analytics instances doesn't stop them from sending events to the back-end sources.

To Reproduce
Steps to reproduce the behavior:

  1. Allocate Analytics instance (1) with support for lifecycle events and connected to the Segment source.
  2. Background the app and watch for application lifecycle event to appear in Segment debugger.
  3. Deallocate analytics instance (1) and allocate Analytics instance (2) with support for lifecycle events and connected to the same Segment source.
  4. Background the app and watch for duplicate application lifecycle events to appear in Segment debugger.
  5. Goto 3. for more fun and more events!

Expected behavior
The Analytics instance should clean up after itself and shutdown its plugins when deallocated. To be clear, I'm not expecting two valid instances to coordinate in any way - that would reasonably produce duplicates, but if there is only one app-wide, live instance that hasn't been released, it should be the only one sending events.

Screenshots
image

Platform (please complete the following information):

  • iOS library version 1.3.0

Additional context
My use case requires my app be able to reconfigure Segment between logins so that I can attach to QA and production depending on the user's preference.

@malhotrachetan
Copy link

Any updates on this?

@frangrolemund
Copy link
Author

Any updates on this?

If it matters, it is possible to work around this issue by explicitly de-initializing elements of the segment client using their public APIs for the internal objects. Although that allowed me to make progress, I'd expect any commercial library to clean up after itself correctly which is why I opened this issue. That feels like a reasonable prerequisite.

@bsneed
Copy link
Contributor

bsneed commented Oct 15, 2022

It's on my short to-do list. Looking at some of these storage issues currently and will circle back soon.

@bsneed
Copy link
Contributor

bsneed commented Oct 17, 2022

Fixed in #164

@bsneed bsneed closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants