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
[x] 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)
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
tostop
to prevent conflicts with Swift since it usesdeinit
rather thandealloc
to deinitialize classes. No kits were using thedeinit
method in the protocol, so while this is technically a public API breaking change, it should have zero impact.Testing Plan
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)