Skip to content

release: 7.67.1#26799

Merged
joaoloureirop merged 5 commits into
stablefrom
release/7.67.1
Mar 5, 2026
Merged

release: 7.67.1#26799
joaoloureirop merged 5 commits into
stablefrom
release/7.67.1

Conversation

@metamaskbot

Copy link
Copy Markdown
Collaborator

🚀 v7.67.1 Testing & Release Quality Process

Hi Team,
As part of our new MetaMask Release Quality Process, here’s a quick overview of the key processes, testing strategies, and milestones to ensure a smooth and high-quality deployment.


📋 Key Processes

Testing Strategy

  • Developer Teams:
    Conduct regression and exploratory testing for your functional areas, including automated and manual tests for critical workflows.
  • QA Team:
    Focus on exploratory testing across the wallet, prioritize high-impact areas, and triage any Sentry errors found during testing.
  • Customer Success Team:
    Validate new functionalities and provide feedback to support release monitoring.

GitHub Signoff

  • Each team must sign off on the Release Candidate (RC) via GitHub by the end of the validation timeline (Tuesday EOD PT).
  • Ensure all tests outlined in the Testing Plan are executed, and any identified issues are addressed.

Issue Resolution

  • Resolve all Release Blockers (Sev0 and Sev1) by Tuesday EOD PT.
  • For unresolved blockers, PRs may be reverted, or feature flags disabled to maintain release quality and timelines.

Cherry-Picking Criteria

  • Only critical fixes meeting outlined criteria will be cherry-picked.
  • Developers must ensure these fixes are thoroughly reviewed, tested, and merged by Tuesday EOD PT.

🗓️ Timeline and Milestones

  1. Today (Friday): Begin Release Candidate validation.
  2. Tuesday EOD PT: Finalize RC with all fixes and cherry-picks.
  3. Wednesday: Buffer day for final checks.
  4. Thursday: Submit release to app stores and begin rollout to 1% of users.
  5. Monday: Scale deployment to 10%.
  6. Tuesday: Full rollout to 100%.

✅ Signoff Checklist

Each team is responsible for signing off via GitHub. Use the checkbox below to track signoff completion:

Team sign-off checklist

  • Mobile Platform

This process is a major step forward in ensuring release stability and quality. Let’s stay aligned and make this release a success! 🚀

Feel free to reach out if you have questions or need clarification.

Many thanks in advance

Reference

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 2, 2026
@github-actions github-actions Bot added the size-S label Mar 2, 2026
@weitingsun weitingsun changed the base branch from stable to release/7.67.0 March 2, 2026 17:29
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

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.

…tate changes (#26809)

- fix(perps): recover connection after app state changes cp-7.67.1
(#26780)

## **Description**

Fixes Perps WebSocket connectivity issues when:
1. **App returns from background** — after a few minutes in background,
the OS silently kills the WebSocket but `PerpsConnectionManager` still
reports `isConnected = true`. No code path detected the stale connection
or triggered reconnection.
2. **WiFi/network drops and restores** — toggling WiFi, airplane mode,
or losing cellular signal kills the WebSocket, but since the app stays
in `active` state, the existing `AppState`-based recovery (if any) never
fires.

### Root Cause

`PerpsConnectionManager` had no lifecycle awareness of:
- **React Native `AppState` transitions** (background → foreground)
- **Network connectivity changes** (offline → online via
`@react-native-community/netinfo`)

Arthur's prior fix
([#26334](#26334)) made
`StreamChannel.ensureReady()` connection-aware to avoid blind polling on
slow connections, but it only helps when a reconnection is **already in
progress** (`isConnecting = true`). After background resume or WiFi
restore, nobody triggers the reconnection in the first place.

### Fix

- **`AppState` listener** — on `active`, cancels any pending grace
period and runs `validateAndReconnect()`
- **`NetInfo` listener** — tracks `wasOffline` state; on offline →
online transition, runs `validateAndReconnect()`
- **`validateAndReconnect(context)`** — shared method that sends a
lightweight `ping()` health check to the active provider. If the ping
fails (stale WebSocket), marks the connection as lost and triggers
`reconnectWithNewContext({ force: true })` which reinitializes the
controller, validates with a fresh health check, and preloads all stream
subscriptions.
- **Cleanup** — both listeners are properly removed in
`cleanupStateMonitoring()`

## **Changelog**

CHANGELOG entry: Fixed Perps WebSocket not reconnecting after app resume
from background or WiFi/network toggle

## **Related issues**

Fixes: connectivity loss after backgrounding app, WiFi off/on not
recovering Perps data

## **Manual testing steps**

```gherkin
Feature: Perps connection recovery

  Scenario: App returns from background after several minutes
    Given the user has navigated to the Perps trading screen
    And the user has an open position

    When the user backgrounds the app for 3+ minutes
    And the user returns to the app
    Then the Perps WebSocket reconnects automatically
    And positions, prices, and account data resume updating

  Scenario: WiFi is toggled off and back on
    Given the user is viewing live Perps positions
    And WiFi is connected

    When the user turns WiFi off
    And waits a few seconds
    And turns WiFi back on
    Then the Perps WebSocket reconnects after network is restored
    And live data resumes without requiring navigation away

  Scenario: Airplane mode is toggled
    Given the user is on the Perps trading screen

    When the user enables airplane mode
    And then disables airplane mode
    Then the connection recovers and live data resumes
```

## **Screenshots/Recordings**

### **Before**

After backgrounding or WiFi toggle, Perps shows stale data with no
automatic recovery. User must navigate away and back to restore the
connection.

### **After**

Connection automatically recovers via health-check ping and force
reconnection. Live data resumes within seconds.

## **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
- [ ] 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).
- [ ] 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]
> **Medium Risk**
> Touches Perps connection lifecycle and reconnection paths; regressions
could cause reconnect loops or delayed/stuck loading during flaky
connectivity.
> 
> **Overview**
> Improves Perps WebSocket resilience by adding AppState and NetInfo
listeners in `PerpsConnectionManager` to detect background→foreground
and offline→online transitions, validate the connection via provider
`ping()`, and force a reconnect when stale.
> 
> Adds network-restore retry/backoff knobs (`NetworkRestoreMaxRetries`,
`NetworkRestoreRetryBaseMs`) and ensures cleanup of new
subscriptions/timers on teardown; reconnection now explicitly calls
`PerpsController.disconnect()` before `init()` to avoid skipping re-init
on a dead socket.
> 
> Updates `usePerpsHomeData` to treat WebSocket-backed sections
(positions/orders/activity) as loading while `isConnecting`, preventing
brief empty-state flashes during reconnection.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b3aab14. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[c4f83e4](c4f83e4)

Co-authored-by: Alejandro Garcia Anglada <aganglada@gmail.com>
@github-actions github-actions Bot added size-M and removed size-S labels Mar 2, 2026
@joaoloureirop joaoloureirop marked this pull request as ready for review March 2, 2026 19:20
@joaoloureirop joaoloureirop requested a review from a team as a code owner March 2, 2026 19:20
joaoloureirop
joaoloureirop previously approved these changes Mar 3, 2026
@joaoloureirop joaoloureirop changed the base branch from release/7.67.0 to stable March 4, 2026 11:52
@joaoloureirop joaoloureirop dismissed their stale review March 4, 2026 11:52

The base branch was changed.

@metamaskbot metamaskbot added the release-7.67.1 Issue or pull request that will be included in release 7.67.1 label Mar 5, 2026
@joaoloureirop joaoloureirop enabled auto-merge March 5, 2026 18:25
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: stable)

All E2E tests pre-selected.

View GitHub Actions results

@joaoloureirop joaoloureirop added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Mar 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Mar 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
22.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@joaoloureirop joaoloureirop merged commit 56726a8 into stable Mar 5, 2026
240 of 297 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.67.1 Issue or pull request that will be included in release 7.67.1 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants