Repository navigation
test(analytics-controller): add messenger action regression tests for setMarketingCampaignCookieId - #10398
Merged
gauthierpetetin merged 1 commit intoSep 23, 2026
Conversation
… setMarketingCampaignCookieId Invokes the AnalyticsController:setMarketingCampaignCookieId messenger action directly (with a value and with null) so that regressions in the messenger wiring are caught even if the controller method is still callable. Follow-up to #10373. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
gauthierpetetin
temporarily deployed
to
default-branch
September 23, 2026 12:25 — with
GitHub Actions
Inactive
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified, and the changes are test-only.
Review effort: Lite
Findings: None
What changed in this PR
Adds messenger-level regression tests for setMarketingCampaignCookieId, covering both setting and clearing the cookie ID.
Changes:
- Tests the action through
messenger.call. - Verifies state updates with a value and clears with
null.
| File | Description |
|---|---|
packages/analytics-controller/src/AnalyticsController.test.ts |
Adds two messenger action regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
gauthierpetetin
enabled auto-merge
September 23, 2026 12:54
NicolasMassart
approved these changes
Sep 23, 2026
2 tasks
gauthierpetetin
deleted the
gauthierpetetin/analytics-controller-messenger-regression-tests
branch
September 23, 2026 13:07
This was referenced Sep 23, 2026
Merged
pull Bot
pushed a commit
to Reality2byte/core
that referenced
this pull request
Sep 23, 2026
## Explanation Publish `@metamask/analytics-controller@3.2.0` so clients can consume the additive changes that have accumulated on `main` since 3.1.0, including the new `marketingCampaignCookieId` state field and `setMarketingCampaignCookieId` messenger action ([MetaMask#10373](MetaMask#10373)). Minor bump: the release only adds new, optional API surface — a new state field initialized to `null` and a new messenger action — so it is not breaking. The field is automatically cleared when the user opts out of marketing or resets their marketing consent decision. ## References - Add `marketingCampaignCookieId` state field and `setMarketingCampaignCookieId` action to `AnalyticsController`: MetaMask#10373 - Add messenger action regression tests for `setMarketingCampaignCookieId`: MetaMask#10398 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Release-only version and changelog updates with a minor, backward-compatible analytics API bump; no runtime logic changes in this PR. > > **Overview** > Cuts **monorepo release 1281.0.0** by publishing **`@metamask/analytics-controller@3.2.0`** and wiring dependents to it. > > The analytics-controller changelog documents **3.2.0** as additive API: a **`marketingCampaignCookieId`** state field (default **`null`**) and **`setMarketingCampaignCookieId`**, with the ID cleared on **`optOutOfMarketing`** or **`resetMarketingConsentDecision`**. **`network-controller`** and **`wallet-cli`** bump **`@metamask/analytics-controller`** to **`^3.2.0`**; **`yarn.lock`** and package version fields are updated accordingly. No application source changes appear in this diff—only release metadata and dependency pins. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9e777df. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This branch was previously deployed
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.
Description
Follow-up to #10373, addressing the Copilot review comment asking for messenger action regression tests for
setMarketingCampaignCookieId, including thenullcase.The tests added in #10373 call the controller method directly, which would keep passing if the method were removed from
MESSENGER_EXPOSED_METHODSor the action type union drifted. This adds two tests in thesetMarketingCampaignCookieIddescribe block that invokeAnalyticsController:setMarketingCampaignCookieIdthrough the messenger:null→marketingCampaignCookieIdis clearedVerification
@metamask/analytics-controllertest suite passes (100% coverage maintained)MESSENGER_EXPOSED_METHODSfails exactly these two tests while the direct-call tests still passyarn lint:eslintpassesChecklist
Note
Low Risk
Test-only change with no production code or runtime behavior modifications.
Overview
Adds two regression tests in the
setMarketingCampaignCookieIdsuite that exercise theAnalyticsController:setMarketingCampaignCookieIdmessenger action instead of calling the controller method directly.One test asserts that invoking the action with a GA cookie ID updates
marketingCampaignCookieIdin state; the other asserts that passingnullclears it. Together they guard against the action being dropped fromMESSENGER_EXPOSED_METHODSor action-type drift while direct-call tests would still pass.Reviewed by Cursor Bugbot for commit be4d68b. Bugbot is set up for automated code reviews on this repo. Configure here.