Skip to content

test(perps): add reusable visible-pipeline probe - #34953

Closed
abretonc7s wants to merge 22 commits into
perf/perps-loading-session-stackfrom
perf/perps-dev-probe-ui-stack
Closed

test(perps): add reusable visible-pipeline probe#34953
abretonc7s wants to merge 22 commits into
perf/perps-loading-session-stackfrom
perf/perps-dev-probe-ui-stack

Conversation

@abretonc7s

@abretonc7s abretonc7s commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Adds one reusable, development-only, platform-neutral visible-pipeline probe on top of #34948. The same perps.performance recipe runs on Android or iOS; --device selects the platform.

The probe records canonical demand, cache/provider/socket delivery, subscriber, React commit, next-frame, resolved, live, and error boundaries while preserving account/context generations. It requires coherent account + positions + orders, uses the pills feed’s own market delivery, never claims trending live-price readiness, and rejects stale demands or mixed atomic bundles.

Production call sites are compile-time gated with __DEV__; semantic delivery metadata is requested only for dev validation. No AgenticBridge performance API, wallet address, order/position ID, platform-specific recipe branch, or raw cache payload is added.

Dependency chain

Validation

  • Probe state machine: 12/12 PASS.
  • Visible-pipeline hook: 2/2 PASS.
  • Account, orders, positions, markets, StreamManager, PerpsSection, and Perps feed focused suites: PASS.
  • Targeted ESLint: 0 errors; Prettier and diff-check: PASS.
  • Full typecheck reports only current-base Lighter and generated Terms errors outside this PR.
  • Independent Claude and Codex consolidated review runs against the final SHA.

Recipe

perps.performance remains the single recipe. Lifecycle, source strategy, account, provider, network, and content variant are parameters; platform is not.

Jira: https://consensyssoftware.atlassian.net/browse/TAT-3662

@abretonc7s abretonc7s self-assigned this Aug 18, 2026
@github-actions

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.

@metamask-ci metamask-ci Bot added the team-perps Perps team label Aug 18, 2026
# Conflicts:
#	app/components/UI/Perps/services/PerpsConnectionManager.ts
# Conflicts:
#	app/components/UI/Perps/hooks/stream/usePerpsLiveOrders.ts
#	app/components/UI/Perps/hooks/stream/usePerpsLivePositions.ts
@github-actions github-actions Bot added size-XL and removed size-L labels Aug 18, 2026
@abretonc7s
abretonc7s changed the base branch from perf/perps-dev-probe-core-stack to perf/perps-loading-session-stack August 18, 2026 23:12
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePreps
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR introduces a new performance instrumentation system for the Perps homepage section. Key changes:

  1. StreamUpdateSource type rename (PerpsStreamManager.tsx): 'fresh''fresh_socket', 'cache''memory_cache', added 'provider_snapshot'. This is a functional change to the stream delivery system that affects how data is routed to subscribers. The deliverStreamUpdate helper and includeDeliverySource subscription option are new production code paths.

  2. PerpsSectionMain.tsx: The onLayout handler is now handleSectionLayout combining both layout and performance callbacks. The isConnected value is now extracted from usePerpsConnection(). These are real production changes.

  3. usePerpsLiveAccount/Orders/Positions.ts: Added includeDeliveryMetadata option and latestDelivery return. The core subscription logic is unchanged; new code only runs when includeDeliveryMetadata=true AND isHomepagePerformanceProbeActive() (DEV-only guard).

  4. homepagePerformanceProbe.ts (new): Entirely DEV-only performance measurement utility.

  5. useHomepagePerpsVisiblePerformance.ts (new): DEV-only performance hook, no-op in production.

  6. PerpsConnectionManager.ts: DEV-only logHomepageConnectionStage calls added.

SmokePerps: Direct changes to Perps stream hooks, connection manager, and homepage section. The StreamUpdateSource rename is a functional change that could affect Perps data delivery behavior.

SmokeWalletPlatform: Perps is a section inside the Trending tab. Changes to PerpsSectionMain.tsx and usePerpsFeed.ts (used in TrendingView) affect the Trending tab display.

SmokeConfirmations: Per tag description, when selecting SmokePerps, also select SmokeConfirmations (Add Funds deposits are on-chain transactions).

Performance Test Selection:
The PR adds a new performance measurement system specifically for the Perps homepage section (homepagePerformanceProbe.ts, useHomepagePerpsVisiblePerformance.ts). While the probe itself is DEV-only, the underlying stream delivery changes (StreamUpdateSource rename, deliverStreamUpdate helper, includeDeliverySource subscription option) affect the actual data flow in production. The PerpsSectionMain.tsx layout handler change (handleSectionLayout combining onLayout + onPerformanceLayout) is production code. Running @PerformancePreps validates that the Perps section still loads and renders correctly with the refactored stream delivery system.

View GitHub Actions results

@abretonc7s abretonc7s changed the title test(perps): connect visible-pipeline probe test(perps): add reusable visible-pipeline probe Aug 18, 2026
@abretonc7s

Copy link
Copy Markdown
Contributor Author

Closing to keep the Mobile delivery minimal. The dev-only probe is not required for production correctness or Sentry instrumentation; reusable local validation belongs in mm-harness/recipes using the canonical #34948 logs and CDP. The branch remains preserved as investigation history.

@abretonc7s abretonc7s closed this Aug 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant