Skip to content

Commit 9a3b5d7

Browse files
authored
Ensure that provider disconnect clears all subscriptions (#5516)
* Ensure that provider disconnect clears all subscriptions * Update CHANGELOG
1 parent f166431 commit 9a3b5d7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# CHANGELOG
22

3+
## master
4+
5+
Contributed:
6+
7+
- Expose per-endpoint stats for providers (Thanks to https://github.com/jeluard)
8+
- Adjust ink! primitive extraction for v4 (Thanks to https://github.com/statictype)
9+
10+
Changes:
11+
12+
- Ensure that provider disconnect clears all subscriptions
13+
- Adjust typegen to internally use `import()` (catering for ESM provided types)
14+
- Update to latest Polkadot, Kusama & Substrate metadata
15+
16+
317
## 9.14.2 Feb 19, 2023
418

519
Changes:

packages/api/src/base/Init.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
373373
}
374374

375375
private _subscribeHealth (): void {
376+
this._unsubscribeHealth();
377+
376378
// Only enable the health keepalive on WS, not needed on HTTP
377379
this.#healthTimer = this.hasSubscriptions
378380
? setInterval((): void => {
@@ -428,7 +430,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
428430

429431
#onProviderDisconnect (): void {
430432
this._isConnected.next(false);
431-
this._unsubscribeHealth();
433+
this._unsubscribe();
432434
this.emit('disconnected');
433435
}
434436

0 commit comments

Comments
 (0)