fix: 25144 QR code popup constantly in explorer screen due to predictions require typed sign to connect. cp-7.63.0#25334
Conversation
…eferral setup - Introduces a global singleton cache to manage signing operations for DEX abstraction, builder fee approval, and referral code setup, preventing repeated signing requests across provider reconnections. - Updates `HyperLiquidProvider` to utilize the new cache for checking and setting DEX abstraction status, ensuring critical operations for hardware wallets are streamlined. - Adds methods in `PerpsConnectionManager` to clear cache entries, enhancing debugging and user experience after signature rejections. - Refactors existing logic to improve handling of concurrent signing attempts and cache state management. This change enhances the user experience by reducing unnecessary signing prompts and improving the efficiency of the DEX abstraction process.
|
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. |
- Updated `HyperLiquidProvider` and `PerpsConnectionManager` to utilize the new `TradingReadinessCache` for managing signing operations related to DEX abstraction and builder fee approvals. - Introduced `TradingReadinessCache` as a global singleton to enhance the efficiency of signing requests and prevent unnecessary prompts during provider reconnections. - Refactored cache clearing methods in `PerpsConnectionManager` to align with the new cache structure, improving overall cache management and debugging capabilities.
…hub.com/MetaMask/metamask-mobile into fix/25144-qr-code-popup-fix-in-explorer
- Added handling for `tradingSetupPromise` in the `HyperLiquidProvider` to ensure it completes before disconnecting. - This change prevents potential state updates after the disconnect process, improving stability during client disconnections.
- Introduced methods to clear specific states (DEX abstraction, builder fee, referral) in the TradingReadinessCache, allowing for more granular cache management. - Updated PerpsConnectionManager to utilize the new cache methods, improving clarity and functionality in cache operations. - Refactored related tests to ensure coverage for the new cache methods and their behaviors, enhancing overall test reliability.
app/components/UI/Perps/controllers/providers/HyperLiquidProvider.test.ts
Show resolved
Hide resolved
app/components/UI/Perps/controllers/providers/HyperLiquidProvider.test.ts
Outdated
Show resolved
Hide resolved
app/components/UI/Perps/controllers/providers/HyperLiquidProvider.test.ts
Outdated
Show resolved
Hide resolved
|
Hello @dawnseeker8 , many thanks for having a look into the issue. I'm not able to test this locally without a HW wallet, could you please share a video of the UX after this change is implemented? |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key changes:
The changes are entirely isolated to the Perps (perpetuals trading) feature within
While the changes modify trading flow initialization, they are internal optimizations with good unit test coverage. The risk is medium because the changes affect the trading setup flow, but the impact is limited to Perps functionality only. Performance Test Selection: |
|



This PR will fix #25144 which constantly popup QR signing transaction.
Root clause
The cause of this issue is little bit complicate,
The issue is that the Explorer/Trending tab has a Perps section that automatically initializes when the tab is clicked. This initialization:
The whole flow like below
solution
implement global signing cache for DEX abstraction and referral setup
HyperLiquidProviderto utilize the new cache for checking and setting DEX abstraction status, ensuring critical operations for hardware wallets are streamlined.PerpsConnectionManagerto clear cache entries, enhancing debugging and user experience after signature rejections.This change enhances the user experience by reducing unnecessary signing prompts and improving the efficiency of the DEX abstraction process.
Description
Changelog
CHANGELOG entry: implement global signing cache for DEX abstraction and referral setup to fix the issue #25144
Related issues
Fixes: #25144
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes when and how perps signing operations (DEX abstraction, builder fee, referral) are triggered, and adds a global cache/lock to suppress retries across reconnections; mistakes could block trading setup or incorrectly skip required signatures.
Overview
Introduces a new global singleton
TradingReadinessCache/PerpsSigningCacheto persist per-user/per-network signing state and coordinate in-flight signing operations across provider reconnections.Refactors
HyperLiquidProviderto defer all signature-requiring setup out ofensureReady()into a newensureReadyForTrading()(used byplaceOrder, cancels, closes, TP/SL updates), and updates DEX abstraction, builder-fee approval, and referral setup to consult/cache results (including failures) and wait on global in-flight locks to avoid repeated hardware-wallet prompts.Adds
PerpsConnectionManagerAPIs to clear DEX abstraction cache for a user or clear all signing cache, and expands/updates tests to cover the new cache behavior and the now non-blocking builder-fee failure behavior.Written by Cursor Bugbot for commit e147571. This will update automatically on new commits. Configure here.