fcl-js icon indicating copy to clipboard operation
fcl-js copied to clipboard

Fcl authorization routine not interrupted after starting a new one

Open Jey-T opened this issue 3 years ago • 0 comments

Instructions

To test it out I used the example Dapp and example Wallet from this repo. I tested with FCL 1.0.3-alpha.0 and FCL 1.3.1 to be sure it wasn't coming from the library version being outdated.

Problem

From what we can read here "Conversely, when FCL sends a new ExtensionServiceInitiationMessage, the previous routine is interrupted. (This is the case even when the new service invocation is targeted at a different extension.)" FCL's routine should be reset every time it emits a new ExtensionServiceInitiationMessage but in practice this is not the case.

Steps to Reproduce

  1. Build Harness (The example Dapp) and the Example wallet.
  2. Click log in on Harness, confirm in the wallet pop up
  3. Click mutate 1 on Harness and select the example wallet in the wallet discovery
  4. Click mutate 2 on Harness and select the example wallet in the wallet discovery At this point you while notice that instead of having only 2 popups you will have 3.
  5. Go back to either of the extension authorization popups and confirm it. if you look at Harness's console, you will notice that even if you confirmed one pop up, the two scripts were sent, you can see them here and here .

https://user-images.githubusercontent.com/89280320/195133882-7900ee62-0758-497b-a200-747d53039429.mp4

Acceptance Criteria

Cleaning FCL's routine when emitting a new ExtensionServiceInitiationMessage.

Context

I am currently working on a wallet and this makes me unable to make the signing part since when the signable is returned, all the scripts from previous routines are also signed and sent to the chain.

Jey-T avatar Oct 11 '22 15:10 Jey-T