Commit graph

6 commits

Author SHA1 Message Date
Kailash Nadh
71ae2bbc09 Fix scheduled campaigns not finishing. Closes #2480. 2025-05-25 11:57:48 +05:30
Kailash Nadh
81b62a4aa9 Fix race condition in immediate campaign pause-start actions.
Pausing a campaign and starting it within the interval where campaign manager
pipe cleanup happens would cause a campaign to be marked as finished. This
patch addresses that by only doing the 'finished' state update if the campaign
wasn't stopped (cancel, pause) manually.

Potentially closes #2278 as this is the only reproducible scenario where a
campaign prematurely gets marked as finished.
2025-04-24 22:40:00 +05:30
Kailash Nadh
007f4de850 Fix a number of cosmetic inconsistenies across handlers and functions.
- Make the beginning of handlers consistent with uniform variable declaration
  and grouping.
- Add missing comments.
- Fix staticcheck/vet warnings and idiom issues.
2025-04-05 13:41:31 +05:30
Kailash Nadh
0d319ad9fd Add 'slug' (permalink) support for campaign archives. Closes #1394. 2024-01-09 23:34:08 +05:30
Kailash Nadh
772476c0df Add accurate sent count, last sent subscriber tracking on campaigns.
- Sent count is no longer the batch size fetched from the DB but is
  the actual count of messages sent.
- Pausing and resuming now accurately tracks the last subscriber that
  was processed and resumes from there.
- Fix multiple concurrent campaigns blocking.

Closes #1616. Closes #905. Closes #1496. Closes #1250. Closes #1010.
2024-01-02 14:57:04 +05:30
Kailash Nadh
414c5c0c99 Refactor the core concurrent campaign manager logic.
This commit fully refactors the core campaign manager logic.
It applies a whole new approach to campaign state and lifecycle management.

- Create a new "pipeline" abstraction on top of campaign
  for state management.
- Account for every message processed and end campaigns
  based on the actual count.
- Discard in-queue messages in the pipeline of a paused
  or cancelled campaign.
2024-01-02 14:57:04 +05:30