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

The isSignedIn() function of Sender Wallet takes too long to get updated #944

Closed
kujtimprenkuSQA opened this issue Sep 26, 2023 · 1 comment · Fixed by #945
Closed

The isSignedIn() function of Sender Wallet takes too long to get updated #944

kujtimprenkuSQA opened this issue Sep 26, 2023 · 1 comment · Fixed by #945
Assignees
Labels
bug Something isn't working Emerging Tech Emerging Tech flying formation at Pagoda

Comments

@kujtimprenkuSQA
Copy link
Contributor

kujtimprenkuSQA commented Sep 26, 2023

Describe the bug

When signed in with Sender in a dApp the window.near.isSignedIn() and window.near.getAccountId() functions of the Sender Wallet are taking too long to set the correct value.

Sender has had this issue where the state on their side does take a bit too long to get updated that's why we have a check https://github.com/near/wallet-selector/blob/main/packages/sender/src/lib/sender.ts#L325-L332

Just found out recently that even a 200ms waiting time is not enough.

To Reproduce
Steps to reproduce the behavior:

  1. Install only Sender on a dApp
  2. Sign In with Sender
  3. Refresh the Page
  4. You will notice that wallet-selector will clear the signed-in state because at the moment when wallet selector checked for getAccountId() the Sender Wallet has returned an "" (empty string).

Expected behavior

When signed with the Sender Wallet in a dApp after a page reload in Wallet Selector best we can do is wait longer for the Sender to return the value.

From what I have found from testing is that sometimes it takes up to 800ms for sender to set update the getAccountId() and isSignedIn()

Screenshots
If applicable, add screenshots to help explain your problem.

sender-state-takes-too-long.webm

Device (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@kujtimprenkuSQA kujtimprenkuSQA added bug Something isn't working Emerging Tech Emerging Tech flying formation at Pagoda Near BOS labels Sep 26, 2023
@kujtimprenkuSQA kujtimprenkuSQA changed the title The isSignedIn() function of Sender Wallet takes too long The isSignedIn() function of Sender Wallet takes too long to get updated Sep 26, 2023
@kujtimprenkuSQA
Copy link
Contributor Author

kujtimprenkuSQA commented Sep 26, 2023

From some more investigation, it was found out that the "waiting" time for the Sender is caused by some other extensions somehow blocking the Sender from updating its state immediately and they are:

  • Metamask (and flask)
  • Nightly
  • xDefi
  • FiNER

When the above extensions are installed even though they are not added to the modules of the wallet selector they block the Sender Wallet from being injected and updated in time:

not-working

If you disable or remove the above extensions then there's no waiting time:

working-fine

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

Successfully merging a pull request may close this issue.

1 participant