Skip to content

feat(audience): remove sandbox routing, add TestMode (SDK-352, SDK-353)#781

Merged
nattb8 merged 1 commit into
mainfrom
feat/sdk-352-353-sandbox-removal-test-mode
May 14, 2026
Merged

feat(audience): remove sandbox routing, add TestMode (SDK-352, SDK-353)#781
nattb8 merged 1 commit into
mainfrom
feat/sdk-352-353-sandbox-removal-test-mode

Conversation

@dom-murray
Copy link
Copy Markdown
Collaborator

@dom-murray dom-murray commented May 14, 2026

Closes SDK-352, SDK-353. Sub-issue of SDK-351.

What changed

Sandbox removal (SDK-352)

  • All publishable keys now resolve to https://api.immutable.com. Key-prefix routing (pk_imapik-test- → sandbox) is gone.
  • Removed TestKeyPrefix, SandboxBaseUrl, WarnIfKeyEnvironmentMismatch, and the two associated log messages.
  • Simplified BaseUrl()/URL helper signatures — publishableKey param dropped. BaseUrl override still works for internal dev environments.
  • Deleted PublishableKeyPrefixTests.cs (tested removed sandbox logic).

Test mode (SDK-353)

  • Added TestMode bool to AudienceConfig (default false). When true, all outbound events carry test: true so the backend can filter them from production data.

Sample app

  • Added TEST MODE toggle (default true) with the same tick-label fix applied to DEBUG and MOBILE ATTRIBUTION toggles.
  • Removed the prod-warning banner — permanently true once sandbox was removed.
  • Updated live-fire tests and constants to match.

Test plan

  • All 317 Audience unit tests pass

Note

Medium Risk
Changes default backend targeting (all keys now send to production unless BaseUrl override is set) and alters the outbound event schema when TestMode is enabled, so misconfiguration could impact where data is sent and how analytics are filtered.

Overview
All publishable keys now default to the production endpoint; key-prefix sandbox routing (pk_imapik-test- → sandbox) and its related constants, URL helpers, warnings, and tests have been removed, with Constants.*Url() helpers simplified to no longer require a publishable key.

Adds AudienceConfig.TestMode (default false) and threads it through ImmutableAudienceMessageBuilder so track/identify/alias payloads optionally include test: true.

Updates the Unity sample app to match: removes the prod-warning banner, adds a TEST MODE toggle (default on) and echoes the config, and adjusts live-fire/unit tests to the new production-default + explicit-override behavior.

Reviewed by Cursor Bugbot for commit 97fd5d1. Bugbot is set up for automated code reviews on this repo. Configure here.

Sandbox removal (SDK-352):
- Remove TestKeyPrefix, SandboxBaseUrl, and key-prefix-based URL routing.
  All keys now resolve to https://api.immutable.com by default; BaseUrl
  override still works for internal dev environments.
- Remove WarnIfKeyEnvironmentMismatch and its log messages.
- Simplify BaseUrl/URL helper signatures (drop unused publishableKey param).
- Delete PublishableKeyPrefixTests.cs and its .meta file.
- Update ConstantsTests, ConsentSyncTests, HttpTransportTests.

Test mode (SDK-353):
- Add TestMode bool to AudienceConfig (default false). When true, every
  outbound event carries test: true so the backend can filter test traffic.
- Add testMode param to MessageBuilder.Track/Identify/Alias; all call sites
  in ImmutableAudience pass config.TestMode.
- Add TestMode tests to AudienceConfigTests and MessageBuilderTests.

Sample app:
- Add test-mode Toggle to UXML (default true) with tick-label workaround
  matching the existing debug toggle.
- Wire TestMode through InitForm → BuildAudienceConfig → BuildConfigEcho.
- Apply same tick-label injection to test-mode and mobile-attribution toggles.
- Remove prod-warning banner (permanently true now that all keys go to prod).
- Replace SandboxBaseUrl with ExplicitBaseUrl in test constants; update
  live-fire tests and stale comments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dom-murray dom-murray requested review from a team as code owners May 14, 2026 00:43
@nattb8 nattb8 enabled auto-merge May 14, 2026 01:03
@nattb8 nattb8 merged commit c18412a into main May 14, 2026
102 of 107 checks passed
@nattb8 nattb8 deleted the feat/sdk-352-353-sandbox-removal-test-mode branch May 14, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants