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

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

Closed
otoole-brendan opened this issue Sep 9, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@otoole-brendan
Copy link

otoole-brendan commented Sep 9, 2023

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)

@otoole-brendan otoole-brendan added the bug Something isn't working label Sep 9, 2023
@otoole-brendan otoole-brendan changed the title Some users unable to enable dapp connection to Wallet UI Some users' dapps are stuck in read only mode as dapp connection approval never succeeds in Wallet UI Sep 9, 2023
@samsiegart
Copy link
Collaborator

I have permission denied on the zenhub image link

@ivanlei
Copy link
Contributor

ivanlei commented Sep 11, 2023

Proposal for rapid resolution:

  • Stand up some .agoric.com DNS which 301s to an RPC node
  • Swap dapps to use this .agoric.com

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

@samsiegart
Copy link
Collaborator

samsiegart commented Sep 11, 2023

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
Copy link
Collaborator

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

We verified that:

  • Dapps use the multiple RPC nodes when a list is in network config
  • Dapps switch between RPC nodes semi-randomly when reloading the dapp
  • RPCs in the list are returning the right response data

@anilhelvaci
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants