Agoric / dapp-card-store

A example dapp for selling baseball cards and other NFTs
29 stars 16 forks source link

refactor: Convert RESM to NESM #31

Closed kriskowal closed 3 years ago

kriskowal commented 3 years ago

Refs: #3687

github-actions[bot] commented 3 years ago

🚀 Deployed on https://612ebb52f71da800a2c1f718--agoric-dapp-card-store.netlify.app

kriskowal commented 3 years ago

The deployed dapp does not fail very gracefully when the user hasn’t set up a wallet bridge properly.

There’s a console error in the deployed dapp, emitted from agoric-wallet.html:

found Agoric wallet [object Object]?suggestedDappPetname=cardStore
agoric-wallet.html?suggestedDappPetname=cardStore:24 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at fromFrame (agoric-wallet.html?suggestedDappPetname=cardStore:24)

The hint appears to be an object where a string is expected. The object is the event.data in a cross-frame MessageEvent, from the local wallet, on https://local.agoric.com/?append=/wallet-bridge.html.

kriskowal commented 3 years ago

I monkey-tested this locally and was able to buy cards. I haven’t had the same good fortune with the PR deployment. The console shows a getBrand related error, and otherwise stalls before displaying cards.

https://gist.github.com/kriskowal/ecc9d45bd69eb617b2c79ee376bee8d0#file-gistfile1-txt-L40-L56

Regardless, I present this for review and could use a second pair of eyes to diagnose the problem with the deployed version. Perhaps it’s because my wallet recognizes two dapp card store instances and they’re getting confused?

katelynsills commented 3 years ago

The deployed dapp does not fail very gracefully when the user hasn’t set up a wallet bridge properly.

There’s a console error in the deployed dapp, emitted from agoric-wallet.html:

found Agoric wallet [object Object]?suggestedDappPetname=cardStore
agoric-wallet.html?suggestedDappPetname=cardStore:24 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at fromFrame (agoric-wallet.html?suggestedDappPetname=cardStore:24)

The hint appears to be an object where a string is expected. The object is the event.data in a cross-frame MessageEvent, from the local wallet, on https://local.agoric.com/?append=/wallet-bridge.html.

@michaelfig is working on rewriting the wallet bridge connection as a reusable component, so I'll turn this into a separate issue and let's make sure it gets closed by the PR that Michael makes.

Edit: issue here https://github.com/Agoric/dapp-card-store/issues/32

kriskowal commented 3 years ago

Completed manual verification. It works!