Agoric / dapp-inter

User application for Agoric Inter Protocol—Vaults, BLD Boost, Liquidations, etc.
2 stars 10 forks source link

Some users' dapps are stuck in read only mode as dapp connection approval never succeeds in Wallet UI #199

Closed otoole-brendan closed 1 year ago

otoole-brendan commented 1 year ago

Describe the bug

Some select users are reporting they are getting a read-only pop-up in PSM and Vaults UIs. When they click Wallet link to approve, and hit approve, the dapp connection is never made and dapp is stuck in read-only mode.

To Reproduce

Steps to reproduce the behavior (for those affected)

  1. Go to Vaults UI
  2. See read-only prompt
  3. go to Wallet UI
  4. Attempt to accept dapp connection
  5. It never suceeds

Expected behavior

Dapp connection request to Wallet should be successful and should no longer be in read-only mode

Screenshots

image

User report;

when I click on it and go to the Dapp, it says it is connecting to the dapp ,but the dapp never appears and refreshing the app.inter.trade page still shows the pop-up 8:09 Under Dev Tools -> Console, I see errors: Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received /#/vaults:1 Access to fetch at 'https://agoric-rpc.polkachu.com/' from origin 'https://bafybeif2df543wgviu2ka6ajoxqqn42p4a4ngvzewy5bgvk2cr6j7cywty.ipfs.cf-ipfs.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. index-83f0ee9f.js:169 POST https://agoric-rpc.polkachu.com/ net::ERR_FAILED 521 batchVstorageQuery @ index-83f0ee9f.js:169 Et @ index-83f0ee9f.js:169 setTimeout (async) xt @ index-83f0ee9f.js:169 Et @ index-83f0ee9f.js:169 index-83f0ee9f.js:40 SES_UNHANDLED_REJECTION: (TypeError#1) error @ index-83f0ee9f.js:40 (anonymous) @ index-83f0ee9f.js:40 at @ index-83f0ee9f.js:40 index-83f0ee9f.js:38 TypeError#1: Failed to fetch wt @ index-83f0ee9f.js:38 ft @ index-83f0ee9f.js:38 error @ index-83f0ee9f.js:40 (anonymous) @ index-83f0ee9f.js:40 at @ index-83f0ee9f.js:40 index-83f0ee9f.js:40 at batchVstorageQuery (https://bafybeif2df543wgviu2ka6ajoxqqn42p4a4ngvzewy5bgvk2cr6j7cywty.ipfs.cf-ipfs.com/assets/index-83f0ee9f.js:169:19166) at Et (https://bafybeif2df543wgviu2ka6ajoxqqn42p4a4ngvzewy5bgvk2cr6j7cywty.ipfs.cf-ipfs.com/assets/index-83f0ee9f.js:169:20558)

samsiegart commented 1 year ago

I have permission denied on the zenhub image link

ivanlei commented 1 year ago

Proposal for rapid resolution:

In the future, in cases of outage of the RPC node, swap the DNS to another community supported RPC that has fewer problems.

samsiegart commented 1 year ago

It will be necessary and sufficient to change the RPC node in https://main.agoric.net/network-config and here (and redeploy wallet-app with the change)

Edit: Sufficient for the rapid solution I mean

samsiegart commented 1 year ago

@michaelfig updated https://main.agoric.net/network-config

We verified that:

anilhelvaci commented 1 year ago

I came across the same problem in local environment as well as with deployed applications yesterday. Basically the request for dapp approval never shows up in the wallet-app's dashboard. When I open the localStorage from wallet-app's tab, I see that there's no dapp stored. However, when I open the localStorage from dapp's tab I can see that the dapp is stored under wallet-app's URL. This made me initially think that maybe something is wrong with the upserDapp method in bridge-dapp.tsx from below:

const requestDappConnection = (dappKey: DappKey, proposedPetname: string) => {
  const dapp = loadDapp(dappKey);
  if (dapp) {
    return;
  }
  upsertDapp(dappKey.smartWalletKey, {
    origin: dappKey.origin,
    petname: proposedPetname,
  });
};

cc @dckc