While working on a project which implements functionality from KittyItems, I noticed that transactions appeared to be forcing currentUser to automatically swap to the ServiceAccount. This is with @onflow/fcl 0.0.78, fcl-dev-wallet:0.3.1, and emulator:latest. This did not happen with fcl-js 0.0.77.
(If you already have it) Clear any cached "web"-related images in Docker.
Update web package.json to "@onflow/fcl": "0.0.78"
Add BASE_URL=http://localhost:8701 to dev-wallet env (in docker-compose.yml)
Deploy the project locally
Login as ServiceAccount, Initialize, and Mint an item
Log out, Fund Account A, login as Account A
Attempt to purchase an item
You will see the following warning in dev console:
You are manually enabling a very experimental feature that is not yet standard, use at your own risk.
You can disable this warning by setting fcl.warning.suppress.redir to true in your config
You'll also see that fcl.currentUser().subscribe has updated the current user back to ServiceAccount. Additionally, you can see that even the Initialize and Mint transactions called when logged in as ServiceAccount caused the warning to fire and currentUser to swap (though, since you're logged in as ServiceAccount at the time, it doesn't impact anything).
Hey @cbcomdev, KittyItems was just updated to use @onflow/fcl:0.0.79-alpha.3 and fcl-dev-wallet:0.3.2. I couldn't reproduce the problem in the latest version, could you give it a try?
Note: I'm cross-posting this from https://github.com/onflow/fcl-js/issues/1017 at the request of @chasefleming
Problem
While working on a project which implements functionality from KittyItems, I noticed that transactions appeared to be forcing currentUser to automatically swap to the ServiceAccount. This is with @onflow/fcl 0.0.78, fcl-dev-wallet:0.3.1, and emulator:latest. This did not happen with fcl-js 0.0.77.
Steps to Reproduce
"@onflow/fcl": "0.0.78"
BASE_URL=http://localhost:8701
to dev-wallet env (in docker-compose.yml)You will see the following warning in dev console:
You'll also see that fcl.currentUser().subscribe has updated the current user back to ServiceAccount. Additionally, you can see that even the Initialize and Mint transactions called when logged in as ServiceAccount caused the warning to fire and currentUser to swap (though, since you're logged in as ServiceAccount at the time, it doesn't impact anything).
This warning is coming from: https://github.com/onflow/fcl-js/blob/master/packages/fcl/src/current-user/index.js#L116