forked from EvolutionAPI/evolution-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
PrismaClientValidationError: Invalid this.cache.delete() is raised in messages.update (stack at /evolution/dist/main.js:227:33183). The code calls cache.delete with a Prisma-style payload instead of a cache key, causing crash loops and dropped Chatwoot sync.
Impact
- Affected instance: 999e9d24-cf32-46f3-b75b-577df5124ef0 (Mama First)
- Date: 2025-11-30 → 2025-12-01
- Symptoms: Prisma errors flooding logs, webhook processing stops, large sync gap (Evolution stored 167 msgs, only 96 synced; Prospek received ~1,824 WAID msgs).
- Similar upstream issues: EvolutionAPI v2.2.3 - Invalid
this.cache.delete()invocation - Argumentpath: Invalid value provided. Expected String, provided (String). EvolutionAPI/evolution-api#1158, erro no log sem efeito aparente: Argumentstatusis missing EvolutionAPI/evolution-api#1266, Mensagens não são enviadas pela API (this.cache.delete()) EvolutionAPI/evolution-api#1852, Erros homolog 09/09/2025 EvolutionAPI/evolution-api#1925, PrismaClientValidationError - Missing messageId in MessageUpdate creation EvolutionAPI/evolution-api#2080 (cache.delete misuse / MessageUpdate validation errors).
Likely Root Cause
cache.delete invoked with {instanceId, keyId, Message: {...}} from messages.update; cache expects a string key.
Proposed Fix
- In
messages.update, derive cache key (e.g., keyId/remoteJid composite) and pass that tocache.delete. - Wrap delete + downstream sync in try/catch to prevent fatal rejection.
- (Optional) Feature flag: if set, skip cache.delete on messages.update to stay merge-friendly until upstream fixes.
Evidence
- Sentry evolution-prod issue EVOLUTION-PROD-3, last seen 2025-12-01T05:02:41Z, culprit POST /chatwoot/webhook/:instanceName.
- Azure logs: 984 PrismaClientValidationError entries Dec 1 (00:12Z–05:00Z).
- PENDING/interactiveMessage traffic correlates with the crash loop.
Acceptance
- No PrismaClientValidationError for cache.delete in messages.update under ad auto-replies, PENDING greetings, reactions/media updates.
- Messages sync to Chatwoot/Prospek resumes; no crash-loop on webhook.
- Feature flag documented (if used).
Metadata
Metadata
Assignees
Labels
No labels