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

feat: Switch workspaces without restarting app #258

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

einsteinx2
Copy link
Contributor

Summary

This new feature enables customers to switch to a new workspace while the app is running. It works by uploading any waiting events, completely resetting the internal data/state of the SDK, stopping/uninitializing any kits that support that (none do yet, but the logic is there to handle it), removing any kits that don't support reinitialization to prevent events forwarding to the wrong accounts, removing all sideloaded kits as new instances will be passed in again via the new MParticleOptions object, and then starts the SDK up fresh using the new API key.

NOTE: A change was made to MPKitProtocol to rename deinit to stop to prevent conflicts with Swift since it uses deinit rather than dealloc to deinitialize classes. No kits were using the deinit method in the protocol, so while this is technically a public API breaking change, it should have zero impact.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Full E2E testing was performed to confirm that waiting events are uploaded, all new events go to the new workspace, and kits are properly handled.
  • New unit tests were added to confirm all behavior
  • Old unit tests confirm existing behavior still works as they use the MParticle reset method which has been updated as part of this change

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@einsteinx2 einsteinx2 merged commit 8f0a027 into development Mar 5, 2024
11 checks passed
@einsteinx2 einsteinx2 deleted the feat/6088-workspace-switching branch March 5, 2024 21:58
mparticle-automation added a commit that referenced this pull request Mar 5, 2024
# [8.20.0](v8.19.0...v8.20.0) (2024-03-05)

### Features

* Switch workspaces without restarting app ([#258](#258)) ([8f0a027](8f0a027))
@mparticle-automation
Copy link
Contributor

🎉 This PR is included in version 8.20.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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 this pull request may close these issues.

None yet

3 participants