Commit 726a90b
authored
fix: prevent invalid bridge tx hashes from being persisted in txHistory (#29136)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->
## **Description**
Bumps the bridge-controller and bridge-status-controller packages. The
new bridge-status-controller version prevents invalid src tx hashes from
being added to the `txHistory`. Additionally, old pending transactions
are removed from state so they don't get polled indefinitely
<!--
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: fix: prevent invalid bridge tx hashes from being
persisted in txHistory
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4380
## **Manual testing steps**
```gherkin
Feature: bridge tx status polling
Scenario: user submits a tx
Given they have STX enabled
When user submits a bridge
Then the status gets updated correctly in the Activity log
Scenario: user submits a tx
Given they have STX disabled, 7702 is supported
When user submits a bridge
Then the status gets updated correctly in the Activity log
Scenario: user submits a Solana tx
Given they have STX enabled
When user submits a bridge
Then the status gets updated correctly in the Activity log
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
N/A
<!-- [screenshots/recordings] -->
### **After**
N/A
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.
Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->
- [ ] 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.
#### 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](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **Pre-merge reviewer checklist**
<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->
- [ ] 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**
> Updates bridge-status integration and dependency versions, including
switching to a new transaction status event; this can affect bridge
status polling and activity updates if event semantics differ.
>
> **Overview**
> Bumps `@metamask/bridge-status-controller` to `^71.0.0` (with
corresponding `yarn.lock` updates) to pick up fixes around bridge tx
history persistence.
>
> Updates the BridgeStatus controller messenger wiring to delegate
`RemoteFeatureFlagController:getState` and to listen to
`TransactionController:transactionStatusUpdated` instead of separate
confirmed/failed events.
>
> Adjusts `BridgeStepDescription` tests to include the new `startTime`
field on mocked `BridgeHistoryItem` data.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e169e5a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 1aaf417 commit 726a90b
4 files changed
Lines changed: 6 additions & 31 deletions
File tree
- app
- components/UI/Bridge/components/TransactionDetails
- core/Engine/messengers/bridge-status-controller-messenger
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8073 | 8073 | | |
8074 | 8074 | | |
8075 | 8075 | | |
8076 | | - | |
| 8076 | + | |
8077 | 8077 | | |
8078 | 8078 | | |
8079 | 8079 | | |
| |||
8106 | 8106 | | |
8107 | 8107 | | |
8108 | 8108 | | |
8109 | | - | |
8110 | | - | |
8111 | | - | |
8112 | | - | |
8113 | | - | |
8114 | | - | |
8115 | | - | |
8116 | | - | |
8117 | | - | |
8118 | | - | |
8119 | | - | |
8120 | | - | |
8121 | | - | |
8122 | | - | |
8123 | | - | |
8124 | | - | |
8125 | | - | |
8126 | | - | |
8127 | | - | |
8128 | | - | |
8129 | | - | |
8130 | | - | |
8131 | | - | |
8132 | | - | |
8133 | 8109 | | |
8134 | 8110 | | |
8135 | 8111 | | |
| |||
35876 | 35852 | | |
35877 | 35853 | | |
35878 | 35854 | | |
35879 | | - | |
| 35855 | + | |
35880 | 35856 | | |
35881 | 35857 | | |
35882 | 35858 | | |
| |||
0 commit comments