Skip to content

feat: Add sandbox mode to attributes#559

Merged
Mansi-mParticle merged 8 commits into
developmentfrom
feat/SQDSDKS-7206-sandbox-mode
Jun 9, 2025
Merged

feat: Add sandbox mode to attributes#559
Mansi-mParticle merged 8 commits into
developmentfrom
feat/SQDSDKS-7206-sandbox-mode

Conversation

@Mansi-mParticle

Copy link
Copy Markdown
Contributor

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • Added logic to include the sandbox mode flag in the attributes map. This flag is only added if it's not already present, with a default value of "false" when the environment value is null.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Tested With sample app and executed test cases

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

@rmi22186 rmi22186 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add tests for the following cases:
Can you add a test case for:

  1. mock the environment and doesn't pass a sandbox attribute to ensure the environment variable is being used
  2. mock the environment as development, but passes sandbox attribute as false and ensure false is set on selectPlacements

Comment thread android-kit-base/src/main/java/com/mparticle/kits/KitManagerImpl.java Outdated

@rmi22186 rmi22186 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this looks good. can you add tests first though?

@Mansi-mParticle Mansi-mParticle force-pushed the development branch 3 times, most recently from 73f2388 to 5910509 Compare April 11, 2025 19:44
@rmi22186

Copy link
Copy Markdown
Member

@Mansi-mParticle looks like this needs to be properly rebased. it has too many commits in it. then you still need to add tests

@Mansi-mParticle Mansi-mParticle force-pushed the feat/SQDSDKS-7206-sandbox-mode branch from 7e0d142 to fddaefd Compare May 1, 2025 16:26
@Mansi-mParticle Mansi-mParticle requested a review from rmi22186 May 1, 2025 19:43
Comment thread android-core/src/main/kotlin/com/mparticle/internal/Constants.kt Outdated
@Mansi-mParticle Mansi-mParticle force-pushed the feat/SQDSDKS-7206-sandbox-mode branch from 9c9ed4d to 8ce20c6 Compare May 12, 2025 21:22
Comment thread android-kit-base/build.gradle
Comment thread android-kit-base/src/main/java/com/mparticle/kits/KitManagerImpl.java Outdated
@Mansi-mParticle Mansi-mParticle force-pushed the feat/SQDSDKS-7206-sandbox-mode branch from 0e00b32 to 5d4cc0e Compare May 30, 2025 21:37
@Mansi-mParticle Mansi-mParticle requested a review from rmi22186 May 30, 2025 21:38

@BrandonStalnaker BrandonStalnaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logic looks good/matches iOS. Had one small question/suggestion on the code but good otherwise

}
}
if (user != null) {
user.setUserAttributes(objectAttributes);

@BrandonStalnaker BrandonStalnaker Jun 2, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The logic here seems a little convoluted to me. Why are we making and updating this new variable objectAttributes ? Could you just

if (user != null) {
                        user.setUserAttributes(objectAttributes);
}

on line 1376 in the if where you confirm its not sandbox mode? Oh maybe there's not a setUserAttribute method? ( a method to set them one at a time)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We only need the attributes except the one for sandbox mode, so objectAttributes should not include the sandbox mode attribute.

@Mansi-mParticle Mansi-mParticle merged commit cbccd13 into development Jun 9, 2025
22 of 24 checks passed
@Mansi-mParticle Mansi-mParticle deleted the feat/SQDSDKS-7206-sandbox-mode branch June 9, 2025 16:45
mparticle-automation added a commit that referenced this pull request Jun 9, 2025
## [5.65.0](v5.64.0...v5.65.0) (2025-06-09)

### Features

* Add sandbox mode to attributes ([#559](#559)) ([cbccd13](cbccd13))

### Bug Fixes

* Add @nonnull and @nullable annotations to execute method parameters ([#579](#579)) ([9089098](9089098))
* add Rokt dimensions layout to show embedded placements correctly ([#580](#580)) ([9d6813c](9d6813c))

### Updates & Maintenance

* Update submodules ([4ed38b5](4ed38b5))
@mparticle-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 5.65.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.

4 participants