fix: address code review feedback (batch 2)
1. Add logger to writeCacheFile (version-cache.ts) - Now logs warnings when file write fails - Helps debugging in production environments 2. Sanitize logging in parseGroupResult (communities.ts) - Changed from info to debug level - Removed full node/groupNode dumps (sensitive data) - Now only logs nodeTag and groupId 3. Add input validation in parseNewsletterCreateResponse (newsletter.ts) - Validates response structure before destructuring - Adds fallback values for parseInt (prevents NaN) - Adds null checks for optional fields 4. Add health-status.ts module - getHealthStatus(): Full health check with circuit breakers, cache, memory - isHealthy(): Simple boolean for liveness probes - getSimpleHealthStatus(): Returns 'ok', 'degraded', or 'error' - Useful for k8s probes and monitoring dashboards
This commit is contained in:
@@ -42,5 +42,8 @@ export * from './unified-session'
|
||||
// Version management
|
||||
export * from './version-cache'
|
||||
|
||||
// Health monitoring
|
||||
export * from './health-status'
|
||||
|
||||
// Event streaming
|
||||
export * from './baileys-event-stream'
|
||||
|
||||
Reference in New Issue
Block a user