• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 14338705355
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 08 Apr 2025 05:05PM UTC
Jobs 1
Files 639
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Apr 2025 04:26PM UTC coverage: 80.928% (+0.03%) from 80.896%
14338705355

push

github

web-flow
feat(massEmails): create celery task for generating daily user lists TASK-1690 (#5640)

### 📣 Summary
Added a new task to generate and enqueue `MassEmailRecords` while
tracking processed configurations using caching.



### 📖 Description
This update introduces a task that processes active MassEmailConfig
entries, gathering all configs with `date_created < today` and
`live==True`, ensuring emails are only sent to eligible users based on
predefined rules. The task:

- Caches processed email configs to avoid duplicate processing.
- If a cache object for today's emails doesn't already exist, it creates
a new cache object `<todays_date>_emails` as an empty set, representing
emails for which today's user list has already been generated.
- Skips configs with existing enqueued or sent records.
- Filters out users who have received the same email within the
configured frequency.
- Handles duplicate entry errors to ensure robustness.

This prevents redundant emails and improves the reliability of the email
queuing system.

### ⚠️ Note

Scheduling this Celery task has been intentionally postponed as per
project requirements. This ensures it does not interfere with existing
email-sending tasks. The implementation focuses solely on generating and
enqueuing email records, with scheduling to be handled in a future
update.

### 👀 Preview steps

1. Set `inactivity_threshold = now() - timedelta(minutes=1)` for the
inactive user query.
2. Create a config with `date_created < today`, `live=True`,
`frequency=-1` and existing records with status `ENQUEUED` or `SENT`.
Run `generate_mass_email_user_lists()` in the shell and verify that no
new records are created.
3. Create a config with `date_created < today`, `live=True` and existing
records with status `ENQUEUED`. Run the function and verify that no new
records are created.
4. Create a config with no records. Run the function and verify that new
records are created.

---------

Co-authored-by: Guillermo <lgar89@gmail.com>

6155 of 9755 branches covered (63.1%)

38 of 38 new or added lines in 1 file covered. (100.0%)

23334 of 28833 relevant lines covered (80.93%)

0.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 14338705355.1 08 Apr 2025 05:05PM UTC 639
80.93
Source Files on build 14338705355
  • Tree
  • List 639
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 11867dd5 on github
  • Prev Build on main (#14330634891)
  • Next Build on main (#14343199833)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc