fether icon indicating copy to clipboard operation
fether copied to clipboard

Subscription problem with light.js

Open amaury1093 opened this issue 6 years ago • 1 comments

On the TokensList page, we subscribe e.g. to balanceOf$(myAddress). This creates a WS subscription to eth_blockNumber (light client listens to new head, updates balance on new block).

Now when we switch to the Send Ether page, this is what happens:

  • TokensList calls componentWillUnmount, so unsubscribes from the Observable balanceOf$(myAddress)
  • balanceOf$(myAddress) will have a subscription count of 0, so the underlying WS subscription is closed (that's a feature of light.js)
  • TxForm calls componentWillMount, and will subscribe again to balanceOf$(myAddress), which will create a new WS subscription to eth_blockNumber

I'm still not sure where to solve this: on the light.js level or on the Fether level.

amaury1093 avatar Oct 27 '18 09:10 amaury1093

Would be fixed with https://github.com/paritytech/js-libs/issues/45 if we decide to go that direction

axelchalon avatar Jan 28 '19 16:01 axelchalon