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

Handle unsubscribes for extension's wasm node #765

Description

@amaury1093

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions