Repository navigation
feat(MBL-2543): move analytics storage when switching to a public key - #926
sydneycollins-cio wants to merge 20 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## mbl-2543-key #926 +/- ##
==================================================
+ Coverage 74.48% 74.54% +0.06%
- Complexity 2395 2439 +44
==================================================
Files 283 284 +1
Lines 13376 13483 +107
Branches 2282 2317 +35
==================================================
+ Hits 9963 10051 +88
- Misses 2600 2604 +4
- Partials 813 828 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Build available to test |
📏 SDK Binary Size Comparison Report
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s to the newest key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s until saved Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mahmoud-elmorabea
left a comment
There was a problem hiding this comment.
Nice work on the migration! 💯
One thing: The migration logic is making me a bit nervous 😅 I think we can make this simpler and keep file IO off the init path, see my comment on CustomerIO.kt.
…prefs are saved Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on key switch Finished batches upload as they are, since analytics uploads every finished file with the key written in it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unknown files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK versions before 4.5.3 don't save their key, so when no saved key is found and the new key is public, look through the analytics-android-* storages. Take the most recently used one whose saved analytics settings name the Customer.io destination. If none do, take a single other key with no settings, skip storage owned by Segment's own SDK, and log and skip when there are several. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mahmoud-elmorabea
left a comment
There was a problem hiding this comment.
Thanks, this is a lot simpler now! 💯 Two things left on the move.
…en batches Copying segment.app.version/build, the legacy build and the device id keeps Segment from tracking Application Installed again after a key switch. Open batches are moved only for the previous key and keys whose settings name our destination, so Segment's own open batch is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit efcc32e. Configure here.
Identity stays all or nothing so one key's anonymousId never pairs with another's userId. App version, build and device id are each copied when missing, so a partial earlier copy can't cause Application Installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Keep the user's identity and unsent events when an app switches over to its public key.
Costs