Skip to content

chore: init fix, catch case where account is not yet setup#29828

Closed
gambinish wants to merge 1 commit into
mainfrom
perps/account-not-found-upgrade
Closed

chore: init fix, catch case where account is not yet setup#29828
gambinish wants to merge 1 commit into
mainfrom
perps/account-not-found-upgrade

Conversation

@gambinish

Copy link
Copy Markdown
Member

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • 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.

@metamaskbotv2 metamaskbotv2 Bot added the team-perps Perps team label May 6, 2026
@github-actions github-actions Bot added the size-M label May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are contained within the Perps controller layer (app/controllers/perps/):

  1. errorUtils.ts: New isHyperLiquidUserNotFoundError() utility to detect when a user has no HyperLiquid account yet.

  2. HyperLiquidProvider.ts: Added a new error-handling branch in #ensureUnifiedAccountEnabled() that gracefully handles the "user not found" case — caches the result with reason: 'no_hl_account' and fires analytics with NOT_APPLICABLE status instead of treating it as a real error. This is a bug fix for new Perps users who haven't yet created a HyperLiquid account.

  3. TradingReadinessCache.ts: Added optional reason discriminator field to SigningOperationState and TradingReadinessCacheEntry types, propagated through get(), set(), and clearUnifiedAccount().

  4. eventNames.ts: Added NOT_APPLICABLE: 'not_applicable' to PERPS_EVENT_VALUE.STATUS constants.

  5. Test files: Unit tests covering the new behavior.

Tag rationale:

  • SmokePerps: Directly impacted — the HyperLiquidProvider initialization flow is changed, specifically the unified account setup path that runs when users open the Perps section. The fix affects new users (no HL account) and the Add Funds flow.
  • SmokeWalletPlatform: Required by SmokePerps tag description — Perps is a section inside the Trending tab, so changes to Perps views/controllers affect Trending.
  • SmokeConfirmations: Required by SmokePerps tag description — Add Funds deposits are on-chain transactions that go through confirmations.

The changes are scoped to Perps internals with no impact on other wallet features (accounts, networks, browser, swaps, etc.).

Performance Test Selection:
The changes are internal error-handling improvements in the Perps controller layer. The TradingReadinessCache change adds a minor reason field to cache entries (negligible memory/performance impact). The HyperLiquidProvider change actually improves performance for new users by adding an early-exit path that prevents repeated failed API calls. No UI rendering changes, no list rendering changes, no app startup changes, and no data loading pipeline changes that would affect measurable performance metrics.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

@gambinish

Copy link
Copy Markdown
Member Author

Closing in favor of #29972

@gambinish gambinish closed this May 11, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 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