refactor(types): drop circuit-breaker SocketConfig fields and default
Removes the 5 optional circuit-breaker config fields exposed via SocketConfig and the corresponding default in DEFAULT_CONNECTION_CONFIG: - enableCircuitBreaker - queryCircuitBreaker - connectionCircuitBreaker - preKeyCircuitBreaker - messageCircuitBreaker Also drops the CircuitBreakerOptions import. Backward compatibility: these were ALL optional. Callers that set them will see no compile error (TypeScript accepts unknown extra props on loose object literals through structural typing) and the values are simply ignored. A future major version may want to mark these as forbidden with a more aggressive type, but for now silent ignore is the least intrusive transition.
This commit is contained in:
@@ -142,8 +142,6 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
getMessage: async () => undefined,
|
||||
cachedGroupMetadata: async () => undefined,
|
||||
makeSignalRepository: makeLibSignalRepository,
|
||||
// Circuit breaker configuration
|
||||
enableCircuitBreaker: true,
|
||||
// Listener limits (memory leak prevention)
|
||||
// WebSocket: 8 core events (open, close, error, message, ping, pong, upgrade, unexpected-response)
|
||||
// + 10 dynamic listeners (reconnect handlers, custom events)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { Agent } from 'https'
|
||||
import type { URL } from 'url'
|
||||
import { proto } from '../../WAProto/index.js'
|
||||
import type { CircuitBreakerOptions } from '../Utils/circuit-breaker'
|
||||
import type { ILogger } from '../Utils/logger'
|
||||
import type { AuthenticationState, LIDMapping, SignalAuthState, TransactionCapabilityOptions } from './Auth'
|
||||
import type { GroupMetadata } from './GroupMetadata'
|
||||
@@ -203,23 +202,6 @@ export type SocketConfig = {
|
||||
pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>
|
||||
) => SignalRepositoryWithLIDStore
|
||||
|
||||
// === Circuit Breaker Configuration ===
|
||||
|
||||
/** Enable circuit breaker protection for socket operations (default: true) */
|
||||
enableCircuitBreaker?: boolean
|
||||
|
||||
/** Circuit breaker configuration for query operations */
|
||||
queryCircuitBreaker?: Partial<CircuitBreakerOptions>
|
||||
|
||||
/** Circuit breaker configuration for connection operations */
|
||||
connectionCircuitBreaker?: Partial<CircuitBreakerOptions>
|
||||
|
||||
/** Circuit breaker configuration for pre-key operations */
|
||||
preKeyCircuitBreaker?: Partial<CircuitBreakerOptions>
|
||||
|
||||
/** Circuit breaker configuration for message operations */
|
||||
messageCircuitBreaker?: Partial<CircuitBreakerOptions>
|
||||
|
||||
// === Listener Limits (Memory Leak Prevention) ===
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user