gigafibre-fsm/apps/ops
louispaulb 07b0331a3a Events: self-serve resume for a send interrupted by a hub restart
A hub restart kills sendEventCampaignAsync's in-memory loop mid-flight,
leaving a campaign stuck at status='sending' with recipients still
'pending' — this happened live today and required a manual server-side
fix. Building a proper resume path instead of relying on that:

- resumeCampaignSend(campaignId): re-reads channel/from/event_id from the
  campaign's own params (nothing to re-enter), refuses if nothing is
  pending or a send is already active, and re-invokes the same worker,
  which skips already-'sent' rows — safe to call on a healthy campaign too.
- Anti-double-send guard (activeEventSends / tryReserveSend): reservation
  now happens synchronously at the scheduling point (massSend/reminderSend/
  resumeCampaignSend), not inside the deferred setImmediate callback —
  closes a race where two near-simultaneous calls could both slip through
  before either worker actually started.
- New route: POST /events/campaign-resume {campaign_id}.
- CampaignDetailPage.vue: "Reprendre l'envoi" button, shown only for
  event-type campaigns stuck at status='sending' with pending recipients.

Verified live: used the new endpoint to resume the real in-progress "On
fête nos 20 ans" campaign after this exact deploy interrupted it — resumed
cleanly with zero duplicate sends.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 10:12:27 -04:00
..
.quasar feat(ops): dispatch auto complet + perf Boîte/rapports + fix session 2026-07-02 08:49:35 -04:00
infra Events: creation, capacity cap, language-tagged attachments, additive audience list 2026-07-09 10:10:43 -04:00
public/icons feat: add ops app + CONTEXT.md, simplify URL to /ops/ 2026-03-30 22:41:58 -04:00
src Events: self-serve resume for a send interrupted by a hub restart 2026-07-24 10:12:27 -04:00
src-pwa feat: nested tasks, project wizard, n8n webhooks, inline task editing 2026-04-01 13:01:20 -04:00
.env.example feat(hub+ops): user invite flow sends temp password via Mailjet + dev .env.example 2026-05-05 19:50:06 -04:00
.env.production security: harden payments/hub auth + remove leaked ERPNext token from source 2026-06-16 06:17:17 -04:00
.gitignore ops: MapLibre/OSM basemap (drop Mapbox) + satellite toggle, unified Créer flow, wizard pricing, infra-first reverse client 2026-07-06 21:52:14 -04:00
deploy.sh infra: deploy.sh renders ops nginx.conf from versioned template w/ server-side token injection 2026-07-08 15:59:48 -04:00
index.html feat: add ops app + CONTEXT.md, simplify URL to /ops/ 2026-03-30 22:41:58 -04:00
knip.json feat(ops): dispatch auto complet + perf Boîte/rapports + fix session 2026-07-02 08:49:35 -04:00
package-lock.json ops: MapLibre/OSM basemap (drop Mapbox) + satellite toggle, unified Créer flow, wizard pricing, infra-first reverse client 2026-07-06 21:52:14 -04:00
package.json ops: MapLibre/OSM basemap (drop Mapbox) + satellite toggle, unified Créer flow, wizard pricing, infra-first reverse client 2026-07-06 21:52:14 -04:00
quasar.config.js ops: MapLibre/OSM basemap (drop Mapbox) + satellite toggle, unified Créer flow, wizard pricing, infra-first reverse client 2026-07-06 21:52:14 -04:00