pioneer icon indicating copy to clipboard operation
pioneer copied to clipboard

πŸ’‰ Inject metadata into signer

Open WRadoslaw opened this issue 2 years ago β€’ 1 comments

WRadoslaw avatar Nov 22 '22 12:11 WRadoslaw

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
dao βœ… Ready (Inspect) Visit Preview May 19, 2023 8:11am
pioneer-2 βœ… Ready (Inspect) Visit Preview May 19, 2023 8:11am
pioneer-2-storybook βœ… Ready (Inspect) Visit Preview May 19, 2023 8:11am

vercel[bot] avatar Nov 22 '22 12:11 vercel[bot]

Context

I've been struggling fixing the tests on this PR. The tests pass on my laptop but they kept on failing with Cannot read property 'createEvent' of null

image

This started happening after the changes from the Ephesus release got merged here.

I think that the issue comes from 2 instances of @polkadot/wasm-crypto running in Pioneer and the in the injectweb3-connect package. The logs show a bunch of warning about this and other polkadot packages (after removing the --silent from the yarn ci-test command).

image

Eventually the log shows: FATAL: Unable to initialize @polkadot/wasm-crypto:: WebAssembly.instantiate(): Out of memory: wasm memory:

image

Finally the CI fails shortly after with Cannot read property 'createEvent' of null.

Here is an example of this happening. BTW on this link and screenshots :point_up_2: I matched the dependencies of injectweb3-connect with Pioneer's but it didn't help.

In the end I just mocked injectweb3-connect which fixed the tests and IMO that's good enough for this PR.

Questions

However in the long run Pioneer should avoid running duplicates of memory intensive polkadot libs. So @WRadoslaw I was wondering:

  1. Do you agree with my conclusions ? or if I might have missed something ?
  2. Did you end up using injectweb3-connect on Atlas too ? Do you think it's worth maintaining this package ?
  3. @talismn/connect-wallets seems to avoid this problem by keeping @polkadot/* in dev dependencies, and declaring them as peer dependencies for production. But for this to work the Webpack target should change, maybe "node" could work (to not bundle the node_modules) or maybe calling tsc could be enough. WDYT ?

thesan avatar Apr 27 '23 15:04 thesan

Tested on https://dao-git-feature-inject-metadata-into-signer-joystream.vercel.app/ Mainnet

@thesan All is works as expected. I am not encountered any problems with updating metadata

Chrome

βœ… Polkadot(successfully updated metadata/wallet is ok) βœ… SubWallet(successfully updated metadata/wallet is ok) βœ… Talisman(metadata up to date/app don’t ask to update)

Brave

βœ… Polkadot(successfully updated metadata/wallet is ok) βœ… SubWallet(successfully updated metadata/wallet is ok) βœ… Talisman(successfully updated metadata/wallet is ok)

Firefox

βœ… Polkadot(successfully updated metadata/wallet is ok) βœ… SubWallet(successfully updated metadata/wallet is ok) βœ… Talisman(successfully updated metadata/wallet is ok)

ivanturlakov avatar May 22 '23 13:05 ivanturlakov

Great work @ivanturlakov :raised_hands:

~~I wasn't expecting it to work with Talisman everywhere. I was just hopping it would not break the wallet.~~ Oh right! it doesn't update on Chrome because it's already up to date...

thesan avatar May 30 '23 10:05 thesan