Skip to content

Commit

Permalink
Ensure that provider disconnect clears all subscriptions (#5516)
Browse files Browse the repository at this point in the history
* Ensure that provider disconnect clears all subscriptions

* Update CHANGELOG
  • Loading branch information
jacogr authored Mar 3, 2023
1 parent f166431 commit 9a3b5d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 3 additions & 1 deletion packages/api/src/base/Init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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');
}

Expand Down

0 comments on commit 9a3b5d7

Please sign in to comment.