Closed AlexandrosGounis closed 3 months ago
Hi @AlexandrosGounis
The issue was caused by the following line https://github.com/airgap-it/beacon-sdk/blob/3026e3f03644ff75c31bd56eb939d87e0513aa11/packages/beacon-dapp/src/dapp-client/DAppClient.ts#L1344
as we already call setActiveAccount
inside onNewAccount
This issue has been addressed in v4.2.1
Describe the bug (current behavior) When using
requestPermissions
for the first time on a DApp, noACTIVE_ACCOUNT_SET
is emitted. If the userdisconnects
and uses a subsequentrequestPermissions
then two, identicalACTIVE_ACCOUNT_SET
events are emitted. Duplicate messages are also emitted when users initiate an account switch event on their wallet.To Reproduce Steps to reproduce the behavior:
requestPermissions
(no event will be emitted the first time)disconnect
orremoveAllAccounts
(anACTIVE_ACCOUNT_SET
event will be emitted with an empty payload)requestPermissions
again (two, identicalACTIVE_ACCOUNT_SET
events will be emitted)Expected (correct) behavior
ACTIVE_ACCOUNT_SET
should only be emitted once when the active account changes.Example
Environment Tested on ghostnet