wacrm/src/app
Arnas Donauskas 11d1c622d0
fix(webhook): run inbound processing in after() so it survives serverless freeze
The POST handler ack'd Meta with 200 and then ran processWebhook() as a
detached promise. On Vercel the function can be frozen/terminated the moment
the response is sent, so those DB writes were not guaranteed to complete.

This dropped a non-deterministic subset of inbound messages: the contact and
conversation rows (written first) landed, but the message insert (written
after) often did not — leaving conversations that appear in the inbox with an
empty thread, with no durable logs to explain it (issue #301).

Move the work into next/server `after()`, which keeps the function alive until
the callback resolves (within the route's maxDuration) while still ack'ing Meta
fast enough to avoid retry-driven duplicate inserts. Add maxDuration=60 for
headroom since processing can fan out to per-media Meta verification calls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 17:34:44 +03:00
..
(auth) fix(theme): light-mode polish from review pass 2026-06-17 09:28:22 +03:00
(dashboard) fix(broadcasts): collect header media URL for image/video templates (#298) 2026-06-25 17:17:18 +03:00
api fix(webhook): run inbound processing in after() so it survives serverless freeze 2026-06-26 17:34:44 +03:00
join feat(theme): add light/dark mode toggle (#243) 2026-06-16 17:29:46 +03:00
globals.css feat(settings): redesign Settings into a grouped rail + Overview landing 2026-06-18 15:08:33 +03:00
icon.tsx feat(theme): sweep remaining violet-* → primary across all surfaces 2026-05-22 17:00:32 +03:00
layout.tsx feat(theme): add light/dark mode toggle (#243) 2026-06-16 17:29:46 +03:00
page.tsx Revert "feat(i18n): re-attempt next-intl with hardened artifact tracing" 2026-05-31 21:05:34 +03:00