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

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

Closed
wants to merge 4 commits into from

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Dec 4, 2023

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

Copy link

github-actions bot commented Dec 4, 2023

Deployed to Cloudflare Pages

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

@lukaw3d lukaw3d changed the title Try ext Try ext (with stable extension ID for easy instructions) Dec 4, 2023
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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%) ⬇️
jest 77.10% <ø> (-0.12%) ⬇️

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

see 5 files with indirect coverage changes

@buberdds
Copy link
Contributor

buberdds commented Mar 26, 2024

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?

@lukaw3d
Copy link
Member Author

lukaw3d commented Mar 28, 2024

😱

  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 lukaw3d changed the title Try ext (with stable extension ID for easy instructions) Try extension - internal release (with stable extension ID for easy instructions) Mar 28, 2024
@donouwens
Copy link

Agreed on point 3.

@lukaw3d
Copy link
Member Author

lukaw3d commented Apr 19, 2024

Superseded by #1899

@lukaw3d lukaw3d closed this Apr 19, 2024
@lukaw3d lukaw3d deleted the lw/try-ext branch April 19, 2024 23:25
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