[pull] main from MetaMask:main#380
Merged
Merged
Conversation
## **Description** There was a caching conflict in the `CandleStreamChannel` between the `usePerpsMarketStats` and `usePerpsLiveCandles` hooks on the asset details page. `usePerpsMarketStats` always subscribes to 1-hour candles, regardless of what interval the chart is displaying. This is because it calculates 24-hour high/low and volume, which requires 24 one-hour candles. However, this would cause a conflict in the cache key that would also cause the chart to render only 24 candles, rather than the full 500 in data set. This was only apparent for the `1h` duration: When viewing 15m chart: Stats subscribes to BTC-1h (24 candles) Chart subscribes to BTC-15m (500 candles) Different cache keys, no conflict When viewing 4h chart: Stats subscribes to BTC-1h (24 candles) Chart subscribes to BTC-4h (500 candles) Different cache keys, no conflict When viewing 1h chart: Stats subscribes to BTC-1h (24 candles) ← first Chart subscribes to BTC-1h (500 candles) ← same key! Same cache key, conflict The 1h interval was the only one where both components competed for the same `coin-interval` cache entry. Causing the chart to not render the full data set. The solution I opted for was to simply always fetch 500 candles. The component that needs less data can just use what it needs from the larger dataset. This way, everyone gets enough data regardless of subscription order. The performance to fetch this amount of data seems negligible. ## **Changelog** CHANGELOG entry: fix 1h candle period on perps chart not displaying full dataset ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2197 ## **Manual testing steps** ```gherkin Feature: Perps chart candle display Scenario: user views 1h candles on market chart Given user is on the market details view When user selects the 1h candle period Then the chart displays several weeks of historical candles ``` ## **Screenshots/Recordings** https://github.com/user-attachments/assets/9c5e9bae-85ad-43a7-85b9-81f7dc33ed55 ## **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** - [ ] 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] > Force `CandleStreamChannel` to always fetch max candles (`YEAR_TO_DATE`) and ignore requested duration; update tests to validate shared connections and caching. > > - **Perps Candle Streaming**: > - Always use `TimeDuration.YEAR_TO_DATE` when subscribing in `CandleStreamChannel` to fetch max candles (500), ignoring requested `duration`. > - Simplify API: remove `duration` from internal `connect(...)` and from subscriber handling; cache key remains `coin-interval`. > - Maintain shared WebSocket per `coin+interval`; disconnect when no subscribers remain; unchanged throttling/cache behaviors. > - **Tests** (`app/components/UI/Perps/providers/channels/CandleStreamChannel.test.ts`): > - Add specs ensuring `YEAR_TO_DATE` is always used, connections are shared across different requested durations, and second subscribers receive cached data immediately. > - Existing tests continue to validate caching, throttling, pause/resume, disconnect, and historical fetch/merge behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3856cef. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
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**
this is a PR that fixes:
performance build issues
test changes according to the new UI
test flakiness fixes
appwright patch to improve some DOM issues we had finding locators due
to nested components
<!--
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?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
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**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] 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**
- [ ] 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]
> Patches Appwright (locators, BrowserStack settings) and refactors
performance tests/screens with new selectors, utilities, and modal
handling to reduce flakiness and match the updated UI.
>
> - **Appwright (patched via Yarn)**:
> - Lower retries/workers in default config; adjust element lookup to
skip text matching; minor logging.
> - BrowserStack: add/update capabilities (networkProfile, selfHeal,
appProfiling), env‑driven buildName, Appium settings, optional video
download via `DISABLE_VIDEO_DOWNLOAD`; apply `updateSettings` on session
start.
> - Wire patch in `package.json`/`yarn.lock`.
> - **Performance tests (Appwright)**:
> - Update login/onboarding/send/swap/asset view flows to new UI; tweak
timers; change tokens (e.g., `USDC`, `LINK`).
> - Add `dissmissPredictionsModal` and use across scenarios; skip perps
onboarding test.
> - Simplify fixture cleanup; always attach metrics; remove orphan timer
recovery/fallback.
> - **Utilities**:
> - New `appwright/utils/Utils.splitAmountIntoDigits`; refactor amount
entry in `AmountScreen`, `SwapScreen`, `BridgeScreen`,
`PerpsDepositScreen`.
> - **Screen objects**:
> - Numerous selector/tap fixes (IDs/text/XPath), iOS exact ID matching,
improved visibility timeouts, scroll-into-view, and modal buttons (e.g.,
Rewards, Login, Networks, Wallet actions).
> - **Config and tooling**:
> - Appwright project configs unchanged functionally (comment cleanup);
extend `.depcheckrc.yml` ignores for Appwright/Appium; minor test
config/timeouts.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e34ae38. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>
## **Description** This PR updates the changelog workflows to use the new `@metamask/auto-changelog@5.3.0` which always filters out direct commits without PR numbers. This ensures all changelog entries represent reviewed and approved changes. **Changes:** - Update `@metamask/auto-changelog` from `^5.1.0` to `^5.3.0` - Update `update-release-changelog` workflow to use `github-tools@v1.1.2` The `--requirePrNumbers` flag is now always applied by default in github-tools, so no additional configuration is needed. This aligns `metamask-mobile` with `metamask-extension` for consistent changelog generation across platforms. ## **Changelog** CHANGELOG entry: null ## **Related issues** - Related to: [MetaMask/metamask-extension#38520](MetaMask/metamask-extension#38520) - ✅ [MetaMask/auto-changelog#253](MetaMask/auto-changelog#253) - Merged (v5.3.0) - ✅ [MetaMask/github-tools#181](MetaMask/github-tools#181) - Merged and released as v1.1.2 ## **Manual testing steps** ```gherkin Feature: Changelog generation with PR number filtering Scenario: Only PR commits appear in changelog Given a release branch exists When a commit with an associated PR is merged Then the changelog should include that commit When a direct commit without PR is pushed Then the changelog should NOT include that commit ``` Tested on [consensys-test/metamask-extension-test](https://github.com/consensys-test/metamask-extension-test) with `release/1100.0.0`: - [Generated changelog](https://github.com/consensys-test/metamask-extension-test/blob/release/1100.0.0-Changelog/CHANGELOG.md) ## **Screenshots/Recordings** ### **Before** Direct commits without PR numbers would appear in the changelog. ### **After** Only commits with PR numbers (representing reviewed changes) appear in the changelog. ## **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** - [ ] 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )