/api/v1/system/relogio/tick authenticates with Bearer INTERNAL_SECRET
inside the route. Without a PUBLIC_PATHS entry the proxy returned 401
before the handler ran, so GitHub Actions could never advance follow-ups.
- Updated `relogio.yml` to clarify scheduling requirements and added concurrency settings for better job management.
- Introduced a new runbook `vercel-hobby-relogio.md` detailing setup instructions for external cron jobs and GitHub Actions.
- Enhanced `executarTickDoRelogio` to improve logging of follow-up advancements, ensuring better tracking of inbound responses.
- Added PowerShell and Bash scripts to facilitate the activation of the clock with necessary commands for GitHub Actions and cron-job.org.
- Implemented tests to validate the clock workflow and URL generation for external cron jobs, ensuring reliability in scheduled task execution.
- Renamed `aplicarTextoNosFollowups` to `aplicarTextoAosEnrollmentsEmEspera` for clarity and updated its parameters to improve functionality.
- Introduced a new test suite for `aplicarTextoNosFollowups`, ensuring proper application of text to follow-ups and validating the expected behavior.
- Enhanced existing tests to verify the integration of the new text application logic, improving overall test coverage and reliability.
- Updated the `matchNode` function to accept an optional `extra` parameter, allowing for dynamic configuration of `FlowNode` properties.
- Simplified test cases by utilizing the updated `matchNode` function to create nodes with specific configurations, improving code readability and maintainability.
- Adjusted related tests to ensure correct behavior with the new flexible node creation approach.
- Introduced a new workflow `relogio.yml` to handle scheduled HTTP requests every 5 minutes, allowing for external triggering of tasks.
- Added a new endpoint `POST /api/v1/system/relogio/tick` to process clock ticks, supporting both admin session and bearer token authentication.
- Implemented task execution logic in `executarTickDoRelogio`, enabling the processing of follow-up tasks and event log drainage without relying on cron jobs.
- Enhanced audit logging for clock tick actions to track task execution and outcomes.
- Created tests for the clock functionality to ensure reliability and correctness of scheduled task processing.
- Added a DELETE endpoint to remove followup flows, including associated enrollments and versions, ensuring proper cascading deletion.
- Introduced `DeleteFollowupFlowButton` component for UI integration, allowing users to delete flows from the interface.
- Updated `FlowsList` to include the delete button for each flow, enhancing user experience.
- Implemented necessary hooks and error handling for the deletion process, including success and error notifications.
- Enhanced audit logging to track deletion actions for followup flows.
- Added tests to verify the functionality of the DELETE endpoint and its integration in the UI.
- Updated `kickLocalPipeline` to accept an optional contact parameter, allowing for targeted processing of follow-ups for specific contacts.
- Modified `POST` request handling in `route.ts` to pass contact details to the pipeline, improving lead processing efficiency.
- Introduced `aplicarEfeitosPosEntrada` in the ingestion process to ensure follow-ups are correctly applied based on inbound messages, enhancing overall responsiveness.
- Enhanced unit tests to verify the new behavior and ensure proper handling of contact-specific follow-up actions.
A captação e o WhatsApp geravam dois contatos (grafias do nono dígito BR); o enrollment ficava waiting_reply no cadastro errado e o job de confirmação reenviava a pergunta. Casa gêmeos de telefone no inbound, não avança match_reply no sent, e canoniza o número na ingestão.
- Added `aplicarTextoNosFollowups` function to apply inbound text to active follow-ups for a contact.
- Updated `kick-local-pipeline.ts` to handle errors when applying inbound text and waking up follow-ups, improving robustness.
- Introduced unit tests for `textoDoPayloadInbound` to ensure correct extraction of text from inbound payloads.
- Registered `followupReactivityHandler` to process inbound messages and apply text to follow-ups, enhancing event handling.
- Updated `MatchReplyForm` to include an `ifExists` state, allowing users to specify behavior when a value already exists (skip, overwrite, or confirm).
- Enhanced the `commit` function to handle the new `ifExists` parameter, ensuring proper processing of match replies based on user input.
- Modified the `describeNodeConfig` function to reflect the new conditional logic in the match reply configuration.
- Updated the `matchReplyConfigSchema` to validate the new `if_exists` field, ensuring correct schema enforcement.
- Enhanced unit tests to cover new scenarios for handling existing values in match replies, improving overall reliability.
- Updated `acelerarPipelineDeEventos` to accept an optional inbound parameter, allowing for targeted follow-up wake-up based on specific message context.
- Introduced `acordarFollowupPorInbound` to handle follow-up events more efficiently, improving responsiveness during inbound lead processing.
- Enhanced unit tests to verify the correct invocation of event acceleration with the new parameters, ensuring proper follow-up behavior.
- Updated `tickFollowupAteParar` to return the number of claimed jobs, improving tracking of processed follow-ups.
- Introduced `enviarTextoFixoPendente` to handle sending fixed messages without relying on cron jobs or agent workers.
- Enhanced error handling in message sending to ensure jobs return to pending status on failure, improving reliability.
- Adjusted `acelerarPipelineDeEventos` to iterate through follow-up ticks and fixed message sending, optimizing event processing.
- Updated comments in `route.ts` to clarify the lead capture process and its implications in production environments.
- Modified `kickLocalPipeline` to ensure immediate processing of events in Vercel's Hobby plan, addressing the lack of a cron job.
- Adjusted `enroll.ts` to omit `next_eval_at` during enrollment, allowing the database's default behavior to manage timing.
- Enhanced unit tests to reflect changes in enrollment behavior and ensure proper handling of lead processing.
- Added `acelerarPipelineDeEventos` function to streamline event processing during inbound lead responses, improving responsiveness.
- Updated `kickLocalPipeline` to utilize the new event acceleration function.
- Enhanced `processNode` to allow early wake-up of wait nodes based on lead responses, ensuring timely follow-up actions.
- Added unit tests to verify the new behavior of wake-up conditions for wait nodes.
- Updated the type definition of the `query` function in the `fakePool` to return a more specific promise type, ensuring better type safety and clarity in unit tests.
- Added comments to clarify the behavior of SQL responses, enhancing the understanding of the test setup.
- Removed redundant code for resolving conversation and channel session IDs in the follow-up turn handler.
- Introduced a new `resolveSendTarget` function to encapsulate logic for determining the appropriate send target, improving code clarity and maintainability.
- Updated error handling to provide clearer messages when a contact cannot be resumed or when a channel is archived.
- Enhanced unit tests to cover new scenarios for handling contacts without conversations and ensuring proper follow-up flow.
- Removed duplicate imports in _client.tsx and LeadFieldsForm.tsx for improved code clarity.
- Updated playSound function to accept a volume parameter, allowing for customizable sound playback levels.
- Adjusted beep function to utilize the new volume parameter, enhancing audio control during notifications.
- Added tests for new volume functionality in sounds.test.ts to ensure reliability.
- Eliminated redundant logging fetch calls from various automation functions and webhook routes to streamline code and improve performance.
- Added a new trigger kind "case_opened" in TriggerConfigControl for better categorization of follow-up actions.
- Cleaned up imports in LeadFieldsForm and KanbanBoard components to remove duplicates and enhance readability.
- Introduced `VAPID_PUBLIC_KEY` and `VAPID_PRIVATE_KEY` to `.env.example` and `.env.hostgator.example` for enabling Web Push notifications.
- Updated `CHANGELOG.md` to document the addition of system alerts with the browser minimized.
- Enhanced `next.config.ts` to support Web Push by adding appropriate headers.
- Added a new script command `dev:crons` in `package.json` for local cron job development.
- Updated dependencies to include `web-push` and its types for TypeScript support.
- Created new design and specification documents for CRM automation flows, detailing the architecture and user stories for visual automation flows.
Permite enviar cartoes de contato pelo inbox (CRM ou telefone manual), com suporte WAHA e Meta Cloud, resolucao do wa_id via check-exists para o nono digito BR, e abertura da conversa ao tocar no cartao dentro do CRM.
Mensagens passam a carimbar contacts.last_activity_at via fn_mark_conversation_message (migration 0162) e envio pelo CRM. A lista /app/contacts ganha order_by/order_dir, cursor corrigido e UI com colunas ordenaveis e paginacao por backend.
O contador só subia em inbound e nunca zerava ao responder, inflando o badge (ex.: 6 com 1 mensagem pendente). Outbound passa a zerar unread, o envio CRM espelha isso, mark-read cobre leitura sem resposta, e a migration recalcula contadores stale.
Lista e detalhe do contato passam a trazer a conversa mais recente e oferecem link direto para o Inbox. O composer também limpa o campo na hora do envio, sem travar até a API responder.
Updated docker-compose files to include the WHATSAPP_RESTART_ALL_SESSIONS environment variable, set to "True" by default. This change ensures that stopped sessions are resumed automatically without requiring user intervention. Additionally, added unit tests to verify the behavior of session resumption logic in the session reconciler.