Ensure that provider disconnect clears all subscriptions (#5516)
* Ensure that provider disconnect clears all subscriptions * Update CHANGELOG
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user