Skip to content

on("accountsChanged") not firing #11403

Open
@davidcallanan

Description

@davidcallanan

An application may request accounts from the user using the eth_requestAccounts RPC method.

The user may refresh this page, leaving a pending account request on MetaMask.

When the user later finishes accepting this account request, the accountsChanged event does not trigger on the page.

Therefore, there is no way of determining if the user has accepted an account request after a page reload has occurred in-between.

Temporary solution which should work: Poll the eth_accounts RPC method every few seconds and if an account appears then it is clear that the user has accepted the account request. This method does not allow you to detect if account request denied.

I assume the purpose of event handlers is to avoid polling like this, so I hope that the event logic gets changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions