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

Refactor transaction ids to be UUIDs instead of random number #20904

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Sep 15, 2023

Explanation

Core TransactionController creates UUID strings as an id for transactions. On the otherside extension creates random number while creating transactions using createRandomId.

While we are on a mission for TransactionController alignment for both clients, for the sake of standardisation the use of UUIDs is preferred.

So this PR aims to make transaction ids to be UUID instead of random number. And also creates a migration for persisted transactions to migrate over UUIDs.

Screenshots/Screencaps

No functional change.

Manual Testing Steps

This PRs manual testing could be tricky since it's using a migration and needs a history of transactions persisted in previous commit. So testing could be done in these steps:

  1. Checkout develop
  2. Send any transaction on any network (just to have some transaction history on the home page)
  3. Checkout 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller
  4. See history persist there without any issue (history should be clickable and detail modal should render without any issue)

Apart from the case above, we need to be able to navigate between transactions on multiple transaction notification:
Screenshot 2023-09-18 at 12 52 24

  1. Try to send some transaction, don't close notification
  2. Open test-dapp on another tab, and do "Personal Sign" (basically creates another transaction)
  3. Try to navigate with the arrows on top of navigation without any issue
image

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@OGPoyraz OGPoyraz added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Sep 18, 2023
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from 5b7a907 to 8c3c64d Compare September 18, 2023 07:03
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from 8c3c64d to 1d50d68 Compare September 18, 2023 07:04
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from 61f7cef to 8bcc8ea Compare September 18, 2023 07:27
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch 2 times, most recently from 36929c3 to 42aa6bb Compare September 18, 2023 08:06
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from 42aa6bb to e060a75 Compare September 18, 2023 08:16
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from c9561f2 to 340ebb8 Compare September 18, 2023 09:08
@OGPoyraz OGPoyraz force-pushed the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch from a7ff201 to c8b485c Compare September 19, 2023 09:47
@metamaskbot
Copy link
Collaborator

Builds ready [c8b485c]
Page Load Metrics (1743 ± 98 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1232151502412
domContentLoaded14962335174220297
load14962335174320398
domInteractive14962335174220297
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 760 Bytes (0.02%)
  • ui: 107 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch coverage: 73.33% and project coverage change: +0.01% 🎉

Comparison is base (bfaaf40) 68.17% compared to head (c8b485c) 68.17%.
Report is 14 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20904      +/-   ##
===========================================
+ Coverage    68.17%   68.17%   +0.01%     
===========================================
  Files          998      999       +1     
  Lines        39966    39982      +16     
  Branches     10686    10689       +3     
===========================================
+ Hits         27243    27256      +13     
- Misses       12723    12726       +3     
Files Changed Coverage Δ
app/scripts/controllers/transactions/index.js 72.73% <ø> (ø)
...ripts/controllers/transactions/tx-state-manager.js 92.31% <ø> (ø)
app/scripts/migrations/index.js 100.00% <ø> (ø)
shared/constants/transaction.ts 100.00% <ø> (ø)
ui/ducks/app/app.ts 56.82% <ø> (ø)
...ion-switch/confirm-transaction-switch.container.js 6.25% <0.00%> (-1.44%) ⬇️
ui/store/actions.ts 43.24% <20.00%> (ø)
...s/transactions/EtherscanRemoteTransactionSource.ts 89.74% <100.00%> (ø)
app/scripts/migrations/098.ts 100.00% <100.00%> (ø)
...saction-base/confirm-transaction-base.container.js 80.36% <100.00%> (ø)
... and 1 more

... and 1 file with indirect coverage changes

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

@OGPoyraz OGPoyraz marked this pull request as ready for review September 19, 2023 10:49
@OGPoyraz OGPoyraz requested a review from a team as a code owner September 19, 2023 10:49
@OGPoyraz OGPoyraz closed this Sep 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
@OGPoyraz OGPoyraz deleted the 1102-use-uuids-for-transaction-ids-in-extension-transaction-controller branch October 18, 2023 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants