Dupe guard 7-day window too short for bi-weekly/monthly campaigns #17

Closed
opened 2026-05-20 09:49:40 -07:00 by pyr0ball · 0 comments
Owner

Bug

The dupe guard in poster.py calls store.already_posted_this_week(campaign_id, target) which only looks back 7 days. Campaigns scheduled less frequently than weekly (bi-weekly, monthly) fall outside this window and re-post identical content.

Observed: Campaign 1 (AuDHD promo) re-fired on 2026-05-12, 21 days after the original 2026-04-21 post. Duplicate post deleted manually.

Fix applied (2026-05-20)

  • store.already_posted_this_week() default window changed from 7 days to 30 days (parameter, so callers can override).
  • campaign_subs.max_posts = 1 set for campaign 1 / r/AuDHD to hard-cap promotional one-shot posts.
  • Add dupe_guard_days field to campaigns table so each campaign can declare its own window (defaults to 30).
  • For promotional campaigns that should only ever post once per sub, max_posts = 1 is the correct tool — add a UI hint when creating a new campaign that this field should be set for one-shot posts.
  • Consider renaming already_posted_this_week to already_posted_recently to avoid misleading the 7-day assumption in future.
## Bug The dupe guard in `poster.py` calls `store.already_posted_this_week(campaign_id, target)` which only looks back 7 days. Campaigns scheduled less frequently than weekly (bi-weekly, monthly) fall outside this window and re-post identical content. **Observed:** Campaign 1 (AuDHD promo) re-fired on 2026-05-12, 21 days after the original 2026-04-21 post. Duplicate post deleted manually. ## Fix applied (2026-05-20) - `store.already_posted_this_week()` default window changed from 7 days to 30 days (parameter, so callers can override). - `campaign_subs.max_posts = 1` set for campaign 1 / r/AuDHD to hard-cap promotional one-shot posts. ## Recommended follow-up - Add `dupe_guard_days` field to `campaigns` table so each campaign can declare its own window (defaults to 30). - For promotional campaigns that should only ever post once per sub, `max_posts = 1` is the correct tool — add a UI hint when creating a new campaign that this field should be set for one-shot posts. - Consider renaming `already_posted_this_week` to `already_posted_recently` to avoid misleading the 7-day assumption in future.
Sign in to join this conversation.
No labels
bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/magpie#17
No description provided.