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

Add V0 extension migration UI #1783

Merged
merged 9 commits into from
Dec 4, 2023
Merged

Add V0 extension migration UI #1783

merged 9 commits into from
Dec 4, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Nov 30, 2023

migration

To load main test data:
inspect new extension's popup and run:

if ((await new Promise(resolve => chrome.storage.local.get('keyringData', resolve))).keyringData) throw 'Already has keyringData. Is this old extension instead of new one?';
chrome.storage.local.set({keyringData: "{\"data\":\"6wVltZe5h8jKU/Lp1Xdq8CnTuzmg3+Pj3n3Mcac/wcbkGWdUVTpA8I8YNY9wyoGrS2wy2h/ITSSoLK/FdATeIZzJAFSpGeEkkdhSvmpjp6Azh2z9xVEhW+jbnRPqR9d45reBkVVbas8Mohp8J2zyj7lNrd3yXhcwbAdmUdtCKVZa3RXmVHx9t8m33xb1kjju9KteQLMEjnncpRNCJq48i+z3AletozbjAiZjRjq9MJhmy1NViR5LcAyQOjGQzuEIPpWikPHxGrDHySWN5mSQjwoSKsHx1M8L9u1ZyYJXADE43QTQtHphSsNzAV3i88GB1LbRez6QqI1ThQXV/NQYwNnWS6INgS5AsmbUBSz2f6uYQoYbzeM15QcbwIUQayMK44Q6C9p+ZzZuf1FKcVAn2LHdhfgUF4dUbOkqe5Irwr05pK6zDznZC9+Zh53SOCsygJV2Yt8CnTStb80PhaxjJRdyB1zwae2KjUliK9G4Pna2R4XI2c4MtB4gcR1tbTC9NWQ5l3IQgLqXwD1nq1pvh1qgCccH5oUYUJoRaeYoew/h2Xmo1rFCJ0R6RHW0cmxLbnWreLf/bBbQfou4EKkF//67IdngkddngYwnraW/Bnn44iNPEa8lDhkGYhiAs2KEB5EfEG/awZQ6DkmwFeeh0H0MuYQUl2MGOSn+EQShjeW1diipB5xDReYUSBfSC09ZB83oTcETZs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ARVvxfqdDy8DvgqMuRjTChICMa5Wqaxg5Hzhem1w9VGMQJhmnFXKJlnoPJbbrZ8ktt2GM0nuOQOOF1SE/opW+SkJt9jzISmwSd8jZzuwoExivckCCt9I9rN9dvDXuUdT7gDFW26UOw9F7U6Zf7vqU5MZonEAh7vWwTyMTiS1hpcrMa6s3zj1C1wPWfgTru5etuuatf/06wuc7elpS8Hf13s5hZoi8kNZCGkHyQaheHcL2vAuN/bjSu+76doU5vZgyziQIMWIkNA/6vRv5yipnCKLSzm0YIGjAXIvRpCmSU7U4EJ1fOtrMcu0HEehOHE4Znu2QfIPWUFP7KYTbjiodKE7+I4tUD85EglExkwHksQ9bPmO57YBoLnqOHdOBVTf8Ev/xum7wMrIJalTvVHC2+R9lp/W9+MPW9WWTc1RJi0y0PuyIa4zgmRcxxCG/uuDasKulC2dhKQQ2h7OvGcYDozducvhV7Vz57dX+gsb1V6wLP013v8sOO6pA7HQVNUAXCSlWjrRL7/qdeDF7g==\",\"iv\":\"xcB9YTpj5KCDyLxoYt9eqQ==\",\"salt\":\"A4K7eVgk+QHpGdGRegzeQ2S6bjEjuTa+zupxVdVG8RE=\"}"});
chrome.extension.getBackgroundPage().location.reload();
location.reload();

Password: Abcd1234&

Or get your data from old extension:

copy(await new Promise(resolve => chrome.storage.local.get('keyringData', resolve)))

@lukaw3d lukaw3d requested review from buberdds and lubej November 30, 2023 03:34
Copy link

github-actions bot commented Nov 30, 2023

Deployed to Cloudflare Pages

Latest commit: 9a79df8d7a71e4461f94dbe4dc8a2e95b0041e14
Status:✅ Deploy successful!
Preview URL: https://5398e3ab.oasis-wallet.pages.dev

export async function deleteV0ExtProfile() {
if (runtimeIs !== 'extension') throw new Error('Can only delete V0 profile in an extension')
const browser = await import('webextension-polyfill')
await browser.storage.local.remove('keyringData')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that I would immediately suggest, let's not delete the migrated encrypted data. Let's save it under different key, keyringDataMigrated or something similar. In case there is a migration edge case we have not foreseen, we can always push a new version to fix it. And after certain time period(1-3 months), push a new version, that would clean up the migration data. The data is encoded, it shouldn't pose any security risk, it should only benefit us.

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Merging #1783 (c15a9b9) into master (d37d499) will decrease coverage by 1.01%.
The diff coverage is 38.01%.

❗ Current head c15a9b9 differs from pull request most recent head 9a79df8. Consider uploading reports for the commit 9a79df8 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1783      +/-   ##
==========================================
- Coverage   82.36%   81.35%   -1.01%     
==========================================
  Files         188      190       +2     
  Lines        4956     5064     +108     
  Branches      912      934      +22     
==========================================
+ Hits         4082     4120      +38     
- Misses        874      944      +70     
Flag Coverage Δ
cypress 45.80% <10.86%> (-1.66%) ⬇️
jest 77.24% <36.66%> (-0.95%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/app/components/AddressFormatter/index.tsx 100.00% <100.00%> (ø)
src/app/state/persist/selectors.ts 91.66% <100.00%> (ø)
src/utils/__fixtures__/test-inputs.ts 100.00% <100.00%> (ø)
src/app/components/Persist/UnlockGate.tsx 84.61% <80.00%> (-4.28%) ⬇️
src/app/state/persist/index.ts 52.38% <50.00%> (-0.26%) ⬇️
src/app/components/RevealOverlayButton/index.tsx 44.44% <44.44%> (ø)
src/utils/walletExtensionV0.ts 79.01% <31.25%> (-10.70%) ⬇️
src/app/state/persist/saga.ts 36.44% <25.00%> (-0.40%) ⬇️
src/app/components/Persist/MigrateV0StateForm.tsx 32.30% <32.30%> (ø)

@buberdds
Copy link
Contributor

buberdds commented Dec 1, 2023

extract-messages

@buberdds
Copy link
Contributor

buberdds commented Dec 1, 2023

Does Address book -> Contact migration work?

@lukaw3d
Copy link
Member Author

lukaw3d commented Dec 1, 2023

e2e test says Address book to contacts works (walletExtensionV0UnlockedState). To manually try it you need to add localStorage.ADDRESS_BOOK_CONFIG

@lukaw3d lukaw3d enabled auto-merge December 4, 2023 12:55
@lukaw3d lukaw3d merged commit 8356cc7 into master Dec 4, 2023
9 of 10 checks passed
@lukaw3d lukaw3d deleted the lw/migrate-ui branch December 4, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants