MOBILE-284: Add shouldIncludeVersionCode option to exclude versionCode#738
Merged
Conversation
…e from User-Agent
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-out flag for including the host app versionCode in identifiers reported by the SDK (notably the User-Agent), while keeping backward-compatible defaults and ensuring persisted configurations migrate safely.
Changes:
- Added
shouldIncludeVersionCodetoMindboxConfiguration/Configurationand wired it through builder → persisted config. - Updated User-Agent / short User-Agent generation to omit
versionCodewhen it’s blank (and to avoid producing empty()/ dangling-). - Bumped Room DB version and added a
3→4migration to persistshouldIncludeVersionCode, plus added Robolectric tests covering the new behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/ConfigurationTest.kt | Adds tests for hostAppVersion and UA formatting with/without versionCode. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/MindboxConfigurationTest.kt | Adds tests verifying shouldIncludeVersionCode controls whether versionCode is populated from PackageInfo. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/repository/MindboxDatabase.kt | Bumps Room schema to v4 and adds migration to add shouldIncludeVersionCode column with default true. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/models/Requests.kt | Updates the User-Agent format template to no longer hard-require a separate versionCode placeholder. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/models/Configuration.kt | Adds shouldIncludeVersionCode field and centralizes host app version formatting for UA generation. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/MindboxConfiguration.kt | Adds builder option + plumbing so versionCode can be excluded (set to empty) when requested. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
enotniy
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://tracker.yandex.ru/MOBILE-284