Skip to content

MOBILE-284: Add shouldIncludeVersionCode option to exclude versionCode#738

Merged
sergeysozinov merged 2 commits into
developfrom
feature/MOBILE-284
Jul 21, 2026
Merged

MOBILE-284: Add shouldIncludeVersionCode option to exclude versionCode#738
sergeysozinov merged 2 commits into
developfrom
feature/MOBILE-284

Conversation

@sergeysozinov

Copy link
Copy Markdown
Collaborator

@sergeysozinov sergeysozinov changed the title MOBILE-284: Add shouldIncludeVersionCode option to exclude versionCod… MOBILE-284: Add shouldIncludeVersionCode option to exclude versionCode Jul 21, 2026
@sergeysozinov
sergeysozinov requested a review from Copilot July 21, 2026 08:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 shouldIncludeVersionCode to MindboxConfiguration/Configuration and wired it through builder → persisted config.
  • Updated User-Agent / short User-Agent generation to omit versionCode when it’s blank (and to avoid producing empty () / dangling -).
  • Bumped Room DB version and added a 3→4 migration to persist shouldIncludeVersionCode, 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.

@sergeysozinov
sergeysozinov requested a review from enotniy July 21, 2026 08:56
Comment thread sdk/src/main/java/cloud/mindbox/mobile_sdk/repository/MindboxDatabase.kt Outdated
@sergeysozinov
sergeysozinov merged commit 04167a0 into develop Jul 21, 2026
7 checks passed
@sergeysozinov
sergeysozinov deleted the feature/MOBILE-284 branch July 21, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants