Skip to content

feat: Support returning a txHash asap, show a notification for a cancelled smart transaction#12465

Merged
dan437 merged 12 commits into
mainfrom
stx-improvements
Nov 28, 2024
Merged

feat: Support returning a txHash asap, show a notification for a cancelled smart transaction#12465
dan437 merged 12 commits into
mainfrom
stx-improvements

Conversation

@dan437
Copy link
Copy Markdown
Contributor

@dan437 dan437 commented Nov 27, 2024

Description

This PR does a few things to support returning a txHash asap after a smart transaction is submitted:

  • Shows a notification for a cancelled smart transaction
  • Requires to send these params when calling the Smart Transactions controller: clientId, getFeatureFlags and updateTransaction

Related issues

Resolves this JIRA ticket: https://consensyssoftware.atlassian.net/browse/TXL-517

Manual testing steps

  1. A feature flag for returning a txHash asap has to be set to true.
  2. It can be tested e.g. via a dapp transaction. A dapp should receive a txHash asap right after submitting a smart transaction
  3. We show a Toast notification for cancelled smart transaction (e.g. when very low gas fees are used) if a user closed the Smart Transaction status page

Screenshots/Recordings

Success Toast:
image

Pending smart transaction:
image

Cancelled smart transaction notification:
image

Before

After

Pre-merge author checklist

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.

@dan437 dan437 requested a review from a team November 27, 2024 13:26
@dan437 dan437 requested a review from a team as a code owner November 27, 2024 13:26
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Nov 27, 2024
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Nov 27, 2024

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 27, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: c81cecb
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/753ae262-33ab-485e-a4a8-0758d6fc0604

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Resolve linting
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 27, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 563de6a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/67209eb6-ead0-4178-b841-ab871aca0916

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions
Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 3a9a426
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/06b8b852-1fb1-4455-99b7-22171bdd1d90

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions
Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: b1db459
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4d682c0a-e6ce-4bd5-b1cd-bcf277f302d4

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 98fb922
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4edc2984-d873-4915-a894-1ac459d9c926

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

klejeune
klejeune previously approved these changes Nov 28, 2024
@dan437 dan437 enabled auto-merge November 28, 2024 16:23
Comment thread app/core/NotificationsManager.test.ts Outdated
Comment thread app/core/NotificationManager.js
Comment thread app/util/smart-transactions/smart-publish-hook.test.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 20852cd
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/96e696ab-dcb5-4481-98c4-bc6b02212d89

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@dan437 dan437 disabled auto-merge November 28, 2024 18:36
@dan437 dan437 enabled auto-merge November 28, 2024 18:36
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 57.03%. Comparing base (22a4989) to head (20852cd).
Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
app/core/Engine/Engine.ts 0.00% 1 Missing ⚠️
app/util/smart-transactions/smart-publish-hook.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12465      +/-   ##
==========================================
+ Coverage   56.41%   57.03%   +0.62%     
==========================================
  Files        1797     1814      +17     
  Lines       40586    40858     +272     
  Branches     5097     5162      +65     
==========================================
+ Hits        22896    23304     +408     
+ Misses      16134    15970     -164     
- Partials     1556     1584      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud
Copy link
Copy Markdown

@dan437 dan437 disabled auto-merge November 28, 2024 18:58
@dan437 dan437 enabled auto-merge November 28, 2024 18:59
Comment thread package.json
Comment thread app/core/Engine/Engine.ts
@tommasini
Copy link
Copy Markdown
Contributor

Would be very nice to have some recordings in the PR description

@dan437 dan437 added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit 0020769 Nov 28, 2024
@dan437 dan437 deleted the stx-improvements branch November 28, 2024 19:53
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 28, 2024
@metamaskbot metamaskbot added the release-7.37.0 Issue or pull request that will be included in release 7.37.0 label Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.37.0 Issue or pull request that will be included in release 7.37.0 team-transactions Transactions team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants