Skip to content

Commit cca8f81

Browse files
committed
Extend createServicePolicy to support live network status
In a future commit we will introduce changes to `network-controller` so that it will keep track of the status of each network as requests are made. These updates to `createServicePolicy` assist with that. See the changelog for a list of changes to the `ServicePolicy` API. Besides the changes listed there, the tests for `createServicePolicy` have been refactored slightly so that it is easier to maintain in the future.
1 parent 698bc87 commit cca8f81

File tree

4 files changed

+1757
-1071
lines changed

4 files changed

+1757
-1071
lines changed

packages/controller-utils/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add `getCircuitState` method to `ServicePolicy` ([#7164](https://github.com/MetaMask/core/pull/7164))
13+
- This can be used when working with a chain of services to know whether a service's underlying circuit is open or closed.
14+
- Add `getLastInnerFailureReason` method to `ServicePolicy` ([#7164](https://github.com/MetaMask/core/pull/7164))
15+
- This can be used when working with a chain of services to obtain the last error that the circuit breaker policy captured after executing the service.
16+
- Add `onAvailable` method to `ServicePolicy` ([#7164](https://github.com/MetaMask/core/pull/7164))
17+
- This can be used to listen for the initial successful execution of the service, or the first successful execution after the service becomes degraded or the circuit breaks.
18+
- Add `reset` method to `ServicePolicy` ([#7164](https://github.com/MetaMask/core/pull/7164))
19+
- This can be used when working with a chain of services to reset the state of the circuit breaker policy (e.g. if a primary recovers and we want to reset the failovers).
20+
- Export `CockatielEventEmitter` and `CockatielFailureReason` from Cockatiel ([#7164](https://github.com/MetaMask/core/pull/7164))
21+
- These can be used to further transform types for event emitters/listeners.
22+
1023
## [11.15.0]
1124

1225
### Added

0 commit comments

Comments
 (0)