Commit 4fe6a2f
authored
fix: ignore incoming transactions in duplicate nonce check (#7097)
## Explanation
Ignore transactions with `isTransfer` set when checking for duplicate
nonces in `PendingTransactionTracker`.
## References
Related to
[#6135](MetaMask/MetaMask-planning#6135)
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Prevents pending transactions from being marked dropped when their
nonce matches an incoming/transfer transaction by refining the
nonce-taken check.
>
> - **PendingTransactionTracker**:
> - Refine `#isNonceTaken` to exclude transactions where `tx.type !==
incoming` AND `tx.isTransfer !== undefined`, avoiding false
duplicate-nonce drops from incoming/transfer transactions.
> - Add unit test ensuring no `transaction-dropped` event when a
matching nonce belongs to an incoming transaction.
> - **Changelog**:
> - Document fix: prevent transactions marked as `dropped` if nonce
matches incoming transaction.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
77e52f5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 62eab6c commit 4fe6a2f
File tree
3 files changed
+38
-1
lines changed- packages/transaction-controller
- src/helpers
3 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
568 | 600 | | |
569 | 601 | | |
570 | 602 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
| 547 | + | |
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
| |||
0 commit comments