Ensure that provider disconnect clears all subscriptions (#5516)

* Ensure that provider disconnect clears all subscriptions

* Update CHANGELOG
This commit is contained in:
Jaco
2023-03-03 12:53:08 +02:00
committed by GitHub
parent f166431b02
commit 9a3b5d7a2c
2 changed files with 17 additions and 1 deletions
+14
View File
@@ -1,5 +1,19 @@
# CHANGELOG
## master
Contributed:
- Expose per-endpoint stats for providers (Thanks to https://github.com/jeluard)
- Adjust ink! primitive extraction for v4 (Thanks to https://github.com/statictype)
Changes:
- Ensure that provider disconnect clears all subscriptions
- Adjust typegen to internally use `import()` (catering for ESM provided types)
- Update to latest Polkadot, Kusama & Substrate metadata
## 9.14.2 Feb 19, 2023
Changes:
+3 -1
View File
@@ -373,6 +373,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
private _subscribeHealth (): void {
this._unsubscribeHealth();
// Only enable the health keepalive on WS, not needed on HTTP
this.#healthTimer = this.hasSubscriptions
? setInterval((): void => {
@@ -428,7 +430,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
#onProviderDisconnect (): void {
this._isConnected.next(false);
this._unsubscribeHealth();
this._unsubscribe();
this.emit('disconnected');
}