This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Description
|
client.rpcSubscribe(JSON.stringify(jsonRpc), (res: string) => { |
|
try { |
|
port.postMessage({ |
|
jsonRpc: { id: jsonRpc.id, ...JSON.parse(res) }, |
|
origin: 'background', |
|
type: 'rpc.sendSubscribe', |
|
}); |
|
} catch (error) { |
|
l.error(`rpcProxySubscribe: Error with ${res} - ${error.message}`); |
|
} |
|
}); |
We subscribe to the light node, but when the port closes, we don't actually call unsubscribe.
I guess we would need to store all the subscriptionIds, and on port.disconnect, call state_unsubscribeStorage() on all those ids.