Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: allow deleting only last tx and duplicates #3554

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Fix: allow deleting only last tx and duplicates #3554

merged 1 commit into from
Apr 16, 2024

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Apr 12, 2024

What it solves

Resolves #3551

How this PR fixes it

Only the last transaction in the queue and transactions with a duplicate nonce are allowed to be deleted.

I used useRecommendedNonce() - 1 to calculate the last transaction nonce.

If a tx is in principle deletable but isn't the last one or a duplicate, we show a tooltip.

Screenshot 2024-04-12 at 14 30 37

Copy link

github-actions bot commented Apr 12, 2024

Copy link

github-actions bot commented Apr 12, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 79.09% 11194/14154
🔴 Branches 58.52% 2649/4527
🟡 Functions 66.03% 1802/2729
🟢 Lines 80.37% 10087/12551

Test suite run success

1419 tests passing in 198 suites.

Report generated by 🧪jest coverage report action from e4cbfd3

@francovenica
Copy link
Contributor

If there are 2 tx with the same nonce, but one of them is a signed Rejection, then I think we shouldn't allow the tx deletion of the "good transaction", since the user would be left with only the rejection, and we know users still don't know that they can create a new tx with an old nonce, so chances are they will end up executing that deletion to get rid of it.

image

Beyond that the ticket is fine.

@katspaugh
Copy link
Member Author

the user would be left with only the rejection, ..., so chances are they will end up executing that deletion to get rid of it.

That's the purpose of a rejection tx though, isn't it?

@katspaugh katspaugh merged commit 28cb04f into dev Apr 16, 2024
14 checks passed
@katspaugh katspaugh deleted the delete-last branch April 16, 2024 07:41
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Delete tx] Avoid nonce gaps in the queue
3 participants