Closed PP-Contrib closed 1 month ago
The changes in the src/jobs/webhooker.ts
file involve a complete overhaul of the delayFunc
logic. The previous single delays
map has been replaced with two distinct maps: dUntil
for tracking the next allowed message time and dVerified
for verifying delays. The new implementation checks for the destination phone, calculates necessary delays, and manages message timing more precisely, enhancing the control flow for message handling.
File | Change Summary |
---|---|
src/jobs/webhooker.ts | Replaced single delays map with dUntil and dVerified maps; improved delay management logic. |
docker-compose-dev-files.yml | Introduced new Docker Compose configuration for development, defining multiple services with environment variables for uno-web and chatwoot-web . |
docker-compose-dev.yml | Added a new configuration for development environments, defining services for uno and chatwoot , including environment variables and configurations. |
sequenceDiagram
participant Client
participant Webhooker
participant DelayManager
Client->>Webhooker: Send message with destination phone
Webhooker->>DelayManager: Check if delay is needed
alt Delay not verified
DelayManager-->>Webhooker: Calculate next message time
Webhooker->>DelayManager: Set next message time
Webhooker->>Webhooker: Await delay
else Delay verified
Webhooker->>Webhooker: Log no further delays
end
Webhooker->>Client: Message sent
🐰 In the meadow where bunnies play,
A new delay logic brightens the day.
With maps that track each time we send,
Our messages flow, on time, they’ll blend!
Hopping through code, we cheer and sway,
For smoother sends, hip-hip-hooray! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes