-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Sistema de webhooks: melhoria com timeout e retentativas configuráveis #1341
base: develop
Are you sure you want to change the base?
[FIX] Sistema de webhooks: melhoria com timeout e retentativas configuráveis #1341
Conversation
…vas inteligente Resolve EvolutionAPI#1325 - Adiciona configuração de timeout via variáveis de ambiente - Implementa backoff exponencial com jitter para retentativas - Detecta erros permanentes para evitar retentativas desnecessárias - Corrige bug de duplicação de webhooks - Melhora logs para diagnóstico
Reviewer's Guide by SourceryThis pull request enhances the webhook system by introducing configurable timeout and retry logic, and fixes a critical bug that caused duplicate webhooks. It also adds support for NATS integration, improves logging, and updates several components to enhance stability and efficiency. Updated class diagram for webhook configurationclassDiagram
class Webhook {
+GlobalWebhook GLOBAL
+EventsWebhook EVENTS
+RequestConfig REQUEST
+RetryConfig RETRY
}
class RequestConfig {
+int TIMEOUT_MS
}
class RetryConfig {
+int MAX_ATTEMPTS
+int INITIAL_DELAY_SECONDS
+bool USE_EXPONENTIAL_BACKOFF
+int MAX_DELAY_SECONDS
+float JITTER_FACTOR
+int[] NON_RETRYABLE_STATUS_CODES
}
Webhook --> RequestConfig
Webhook --> RetryConfig
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We encountered an error and are unable to review this PR. We have been notified and are working to fix it.
You can try again by commenting this pull request with @sourcery-ai review
, or contact us for help.
Pelo amor da deusa põe libera o update disso chefinho @DavidsonGomes . Meu bot do dyfy trava com erros de timeout ou quando da algum erro tipo 401 e nao tenta denovo enviar ou receber uma msg ,e fica pra sempre travado. Resolveria esse cenário? Pois são "conversas entre webhook" essas integrações de chabot,correto? |
const httpService = axios.create({ | ||
baseURL: globalURL, | ||
timeout: webhookConfig.REQUEST?.TIMEOUT_MS ?? 30000, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acredito que de para criar um método que receba a url e o timeout em milisegundos como parâmetro pra poder usar tanto nessas linhas quanto na linha 115-118
Referência
Resolve #1325
Descrição
Esta PR implementa melhorias significativas no sistema de webhooks da API, adicionando configurabilidade via variáveis de ambiente e corrigindo o bug crítico que causava duplicação de webhooks.
Problemas Resolvidos
Novas Configurações
Todas estas configurações são opcionais e possuem valores padrão razoáveis:
Impacto e Compatibilidade
Testes Realizados
Alterações Implementadas
Summary by Sourcery
Improves the webhook system by adding configurable options for timeout and retry logic, and fixes a bug that caused duplicate webhooks. It introduces environment variables to configure the webhook system.
Bug Fixes:
Enhancements:
Summary by Sourcery
Improve the webhook system by adding configurable timeout, retry logic, and preventing duplicate webhook sends
New Features:
Bug Fixes:
Enhancements:
Deployment:
Documentation: