oasis-wallet-web icon indicating copy to clipboard operation
oasis-wallet-web copied to clipboard

Try extension - internal release (with stable extension ID for easy instructions)

Open lukaw3d opened this issue 2 years ago • 5 comments

Try new extension:

  • These steps will install next version as a separate extension, and copy the data
  • open chrome://extensions/
  • click top right to enable Developer mode
  • download oasis-wallet-web-ae56f54.zip (generated by /actions/runs/8462200220?pr=1787)
  • drag it into chrome://extensions/
  • to copy data from old extension: open chrome-extension://ppdadbejkmjnefldpcdjhnkpbjkikoip/manifest.json and open console (Option+⌘+J or Shift+Ctrl+J) and run:
    if (location.href !== 'chrome-extension://ppdadbejkmjnefldpcdjhnkpbjkikoip/manifest.json') throw 'Is this the new extension instead of old one?';
    copy(`
    if ((await new Promise(resolve => chrome.storage.local.get('keyringData', resolve))).keyringData) throw 'Already has keyringData. Is this old extension instead of new one?';
    const chromeStorageLocal = ${JSON.stringify(await new Promise(resolve => chrome.storage.local.get(null, resolve)))};
    await new Promise(resolve => chrome.storage.local.set(chromeStorageLocal, resolve));
    Object.entries(${JSON.stringify(window.localStorage)}).forEach(([k, v]) => window.localStorage.setItem(k, v));
    chrome.extension.getBackgroundPage().location.reload();
    location.reload();
    `)
    
  • chrome-extension://jeooipjboldjebnajiegnfpklodgimmf/manifest.json open console and paste.
  • click the new extension

lukaw3d avatar Dec 04 '23 15:12 lukaw3d

Deployed to Cloudflare Pages

Latest commit: 7c89dce09bd4df28149f6ee24be4df84c25570ef
Status:✅ Deploy successful!
Preview URL: https://4a7dd530.oasis-wallet.pages.dev

github-actions[bot] avatar Dec 04 '23 15:12 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.24%. Comparing base (21e94f9) to head (7c89dce). Report is 11 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1787      +/-   ##
==========================================
- Coverage   81.31%   81.24%   -0.08%     
==========================================
  Files         192      192              
  Lines        5064     5070       +6     
  Branches      933      933              
==========================================
+ Hits         4118     4119       +1     
- Misses        946      951       +5     
Flag Coverage Δ
cypress 46.03% <ø> (-0.02%) :arrow_down:
jest 77.10% <ø> (-0.12%) :arrow_down:

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

see 5 files with indirect coverage changes

codecov[bot] avatar Mar 25 '24 23:03 codecov[bot]

Tutorial issues:

  1. Shouldn't we update old extension ID in "Try new extension with data from old extension" section to ppdadbejkmjnefldpcdjhnkpbjkikoip?
  2. I think tutorial may not work for most of testers due to JSON.stringify(window.localStorage.getItem('ADDRESS_BOOK_CONFIG')) line when you never interacted with address book it is undefined and this line will return 'null' and migration won't work, because of Unhandled Rejection (TypeError): addressBookAccounts is not iterable. This won't happend in "real' migration as we default to '[]' in code.
  3. What's a plan for users that forgot password? They will stuck in "Important Wallet Update" view, right?

buberdds avatar Mar 26 '24 10:03 buberdds

:scream:

  1. fixed extension ID

  2. Good catch! I'll change:

    - window.localStorage.ADDRESS_BOOK_CONFIG = ${JSON.stringify(window.localStorage.getItem('ADDRESS_BOOK_CONFIG'))};
    - window.localStorage.LANGUAGE_CONFIG = ${JSON.stringify(window.localStorage.getItem('LANGUAGE_CONFIG'))};
    - window.localStorage.NETWORK_CONFIG = ${JSON.stringify(window.localStorage.getItem('NETWORK_CONFIG'))};
    - window.localStorage.DISMISSED_NEW_EXTENSION_WARNING = ${JSON.stringify(window.localStorage.getItem('DISMISSED_NEW_EXTENSION_WARNING'))};
    + Object.entries(${JSON.stringify(window.localStorage)}).forEach(([k, v]) => window.localStorage.setItem(k, v));
    

    Readable, but not ideal (doesn't clear values if ran once for profile with ADDRESS_BOOK_CONFIG and again for profile without)

  3. Yep. I think it's unlikely enough to happen that we don't need a delete flow inside migration. (One workaround is to uninstall+reinstall the extension) cc @donouwens

lukaw3d avatar Mar 28 '24 03:03 lukaw3d

Agreed on point 3.

donouwens avatar Mar 28 '24 07:03 donouwens

Superseded by https://github.com/oasisprotocol/oasis-wallet-web/pull/1899

lukaw3d avatar Apr 19 '24 23:04 lukaw3d