chore(runway): cherry-pick fix: disable Branch test instance and debug mode in branch.json cp-7.71.0#27889
Conversation
…g mode in branch.json cp-7.71.0 (#27879) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> `branch.json` had `useTestInstance: true` and `debugMode: true`, which forced **all builds** — including production RC — to initialize the Branch SDK against the **test environment**. Branch short links (e.g. `metamask.app.link/1WkF6GmE40b`) are created in the **live** Branch dashboard, so the test-instance SDK could never resolve them: the test and live environments are separate databases. This was the root cause of the "This page doesn't exist" error when opening Branch deepview short links (e.g. from Twitter/X). The SDK returned `+clicked_branch_link: false` and `+non_branch_link` with the raw URL because the test environment had no record of live links. The fix sets both values to `false` so the SDK uses the live key from the native configuration (`Info.plist` / `AndroidManifest.xml`), matching the environment where links are actually created. **Note:** The same `branch.json` content is also present at `android/app/src/main/assets/branch.json` — both platforms are affected. This PR fixes the root config; the Android copy should also be verified/updated. ## **Changelog** CHANGELOG entry: Fixed Branch.io deep links not resolving by switching SDK from test to live environment ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Branch short link deep linking Background: Given I have a production RC build installed And the app is using the live Branch key Scenario: user opens a Branch short link from cold start Given the app is not running When user taps a Branch deepview link (e.g. https://metamask.app.link/1WkF6GmE40b) Then the app should open And the user should be navigated to the intended destination (e.g. Trending page) And the "This page doesn't exist" modal should NOT appear Scenario: user opens a Branch short link from warm start (app backgrounded) Given the app is running in the background When user taps a Branch deepview link Then the app should come to foreground And the user should be navigated to the intended destination Scenario: user opens a direct universal link (non-Branch) Given the app is installed When user taps https://link.metamask.io/trending Then the Trending page should open normally And behavior should be unchanged from before this PR ``` ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk config-only change, but it affects deep link behavior across builds by switching Branch initialization away from the test environment. > > **Overview** > Disables `debugMode` and `useTestInstance` in `branch.json`, ensuring the Branch SDK initializes against the **live** environment rather than the test instance. > > This should restore proper resolution of production Branch short links/deepviews that previously failed when the app was forced to use the test Branch database. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 33fcef1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are SDK configuration flags with no references in the application TypeScript/JavaScript codebase (grep confirmed
This is a low-risk release preparation change (ensuring production Branch SDK settings are active). No E2E tests need to run to validate this configuration change. Performance Test Selection: |
|



Description
branch.jsonhaduseTestInstance: trueanddebugMode: true, whichforced all builds — including production RC — to initialize the
Branch SDK against the test environment. Branch short links (e.g.
metamask.app.link/1WkF6GmE40b) are created in the live Branchdashboard, so the test-instance SDK could never resolve them: the test
and live environments are separate databases.
This was the root cause of the "This page doesn't exist" error when
opening Branch deepview short links (e.g. from Twitter/X). The SDK
returned
+clicked_branch_link: falseand+non_branch_linkwith theraw URL because the test environment had no record of live links.
The fix sets both values to
falseso the SDK uses the live key fromthe native configuration (
Info.plist/AndroidManifest.xml),matching the environment where links are actually created.
Note: The same
branch.jsoncontent is also present atandroid/app/src/main/assets/branch.json— both platforms are affected.This PR fixes the root config; the Android copy should also be
verified/updated.
Changelog
CHANGELOG entry: Fixed Branch.io deep links not resolving by switching
SDK from test to live environment
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Low Risk
Low risk config-only change, but it affects deep link behavior across
builds by switching Branch initialization away from the test
environment.
Overview
Disables
debugModeanduseTestInstanceinbranch.json, ensuringthe Branch SDK initializes against the live environment rather than
the test instance.
This should restore proper resolution of production Branch short
links/deepviews that previously failed when the app was forced to use
the test Branch database.
Written by Cursor
Bugbot for commit
33fcef1. This will update automatically
on new commits. Configure
here.