fether
fether copied to clipboard
Subscription problem with light.js
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 ObservablebalanceOf$(myAddress) balanceOf$(myAddress)will have a subscription count of 0, so the underlying WS subscription is closed (that's a feature of light.js)TxFormcallscomponentWillMount, and will subscribe again tobalanceOf$(myAddress), which will create a new WS subscription toeth_blockNumber
I'm still not sure where to solve this: on the light.js level or on the Fether level.
Would be fixed with https://github.com/paritytech/js-libs/issues/45 if we decide to go that direction