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

Error when a wallet is disconnected/severs connection. Halts execution #43

Closed
IamBatmanYourDad opened this issue Apr 24, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@IamBatmanYourDad
Copy link

Hello,

I wanted to use the OnDisconnect event to detect wallet changes/disconnects so the user could be prompted. However due to the below error, I can't do that. Unless I'm doing something stupidly wrong (in which case, please let me know how I can correctly do this), please confirm the issue.

I'm using SDK version 1.2.0, but this is reproduced in 1.2.1 as well.

The error comes from walletbeacon.min.js apparently. The game loop doesn't have a chance to be triggered since it never reaches there, it happens on the web app itself.

Steps to reproduce:

  • Use Airgap as web template and build the demo app/sample app on WebGL.
  • Click login and connect any wallet.
  • Once logged in, simply sever connection from the wallet.
  • On checking the console, you'll see the error. Reproduced on Firefox and other chromium based browsers.

The below error log is from firefox, but similar logs would be available from other browsers.

Uncaught Error: Permission denied to access property "apply"
    onerror moz-extension://253c8873-2f90-4700-92e8-08c01dca50f1/content_script/inpage_sol.js:143
inpage_sol.js:143:16115
    onerror moz-extension://253c8873-2f90-4700-92e8-08c01dca50f1/content_script/inpage_sol.js:143

-----------------------------------------------------------------------------------------------------------------------------

Uncaught Error: Permission denied to access property "apply"
    onunhandledrejection moz-extension://253c8873-2f90-4700-92e8-08c01dca50f1/content_script/inpage_sol.js:143
inpage_sol.js:143:16268
    onunhandledrejection moz-extension://253c8873-2f90-4700-92e8-08c01dca50f1/content_script/inpage_sol.js:143

-----------------------------------------------------------------------------------------------------------------------------

Uncaught (in promise) TypeError: typedMessage.message is undefined
    DAppClient http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    handleResponse http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    Client http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    Client http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    Transport http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    Transport http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    notifyListeners http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    P2PTransport http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    callbackFunction http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    callbackFunction http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emit http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emit http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emitClientEvent http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emitMessage http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emitMessage http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    emitIfEvent http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    onStateChanged http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    MatrixClient http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    notifyListeners http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    notifyListeners http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    MatrixClientStore http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    update http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    initialPollingResult http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    initialPollingResult http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    pollSync http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    pollSync http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    pollSync http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    pollSync http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    setTimeout handler*[274]</MatrixClient.prototype.poll/MatrixClient</</pollSync/</< http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    verb http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    fulfilled http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    promise callback*step http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
    __awaiter http://127.0.0.1/StreamingAssets/walletbeacon.min.js:1
walletbeacon.min.js:1:1369870

@m-kus m-kus added the bug Something isn't working label Apr 25, 2023
@m-kus m-kus assigned mismirnov and unassigned k-karuna May 9, 2023
@IamBatmanYourDad
Copy link
Author

Hello, wondering if there's any update on this?

@m-kus
Copy link
Collaborator

m-kus commented May 22, 2023

Hi! There were several WebGL issues we fixed in 1.4.0 that might resolve this, but we will also try to reproduce your issue on the newer version.

@m-kus m-kus mentioned this issue May 22, 2023
@IamBatmanYourDad
Copy link
Author

Hi! There were several WebGL issues we fixed in 1.4.0 that might resolve this, but we will also try to reproduce your issue on the newer version.

Hello, sorry for the late reply. But just tested this out with 1.4.0, within my project and even in an empty project, it's still producing the same error along with a new exception.

This leads me to wonder, how is everyone and you guys detecting wallet disconnects? Are is that not being detected?

@mismirnov
Copy link
Contributor

Use BeaconMessageReceiver (WalletMessageReceiver in the future), OnAccountDisconnected function to detect wallet disconnection.

public void OnAccountDisconnected(string result)

@mismirnov
Copy link
Contributor

@IamBatmanYourDad Do you still have this issue?

@k-karuna
Copy link
Member

We have refactored WebGL frontend app and updated Typescript Beacon dependency, so now issue didn't reproduce.

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