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

kobotoolbox / kpi / 23954362374
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 03 Apr 2026 04:59PM UTC
Jobs 10
Files 887
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

03 Apr 2026 04:55PM UTC coverage: 81.717% (+0.01%) from 81.703%
23954362374

push

github

web-flow
fix(massEmails): do not disable emails before they are sent DEV-1953 (#6915)

### 📣 Summary
Fixes a bug that was disabling one-time email sends before they could be
sent.


### 📖 Description
When users created one-off emails after the daily send lists had been
generated, they were automatically getting turned off (having `Live` set
to False) before they could actually be sent.


### 💭 Notes

Eventually we probably want to show the users in Django admin if we
tried to send a one-off email but there were no recipients, but we don't
have a good mechanism yet for saving those errors and adding one is
beyond the scope of this more urgent fix.
We still keep empty MassEmailJobs around because they are the only
persisted record of when we tried to send an email, whether or not any
emails were generated.

### 👀 Preview steps
Note: recreation of the bug is very finicky and very much based on
timing

Make sure `MASS_EMAILS_CONDENSE_SEND` is True. Remember to restart the
kpi worker in after switching branches.

1. Add test users to `MASS_EMAIL_TEST_EMAILS` in Constance
2. Create a new `MassEmailConfig` Test1 that uses `test_users` and has
frequency = 1 and set it live. This is just so
generate_mass_send_emails() will always have something to generate. Wait
5 m to ensure a send list gets generated.
3. Create another `MassEmailConfig` Test2 that uses the `test_users`
query and has frequency = -1. Do not set it live yet.
4. at least 2 minutes past and 6 minutes before a 15 minute boundary,
set Test2 email live (eg at 1:02-1:09, 1:17-1:24, 1:32-1:39, 1:47-1:54).
5. Wait at least 5 minutes 
6. Open the config in Django admin
7. 🔴 [on main] The config is no longer live even though no emails have
been sent
8. 🟢 [on PR] The config is still live
9. 🟢 At the next 15 minute boundary, the one-time email sends

7441 of 11558 branches covered (64.38%)

0 of 5 new or added lines in 1 file covered. (0.0%)

27 existing lines in 4 files now uncovered.

28561 of 34951 relevant lines covered (81.72%)

5.81 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
0.0
0.0% kobo/apps/mass_emails/tasks.py

Coverage Regressions

Lines Coverage ∆ File
24
74.76
-23.3% kpi/utils/usage_calculator.py
1
0.0
0.0% kobo/apps/mass_emails/tasks.py
1
92.31
-7.69% kobo/apps/user_reports/utils/migrations.py
1
85.0
-5.0% kpi/urls/__init__.py
Jobs
ID Job ID Ran Files Coverage
1 23954362374.1 03 Apr 2026 04:59PM UTC 883
53.19
2 23954362374.2 03 Apr 2026 05:00PM UTC 883
54.68
3 23954362374.3 03 Apr 2026 05:01PM UTC 885
54.45
4 23954362374.4 03 Apr 2026 05:01PM UTC 885
55.96
5 23954362374.5 03 Apr 2026 05:01PM UTC 883
53.52
6 23954362374.6 03 Apr 2026 05:02PM UTC 885
65.37
7 23954362374.7 03 Apr 2026 05:02PM UTC 883
60.43
8 23954362374.8 03 Apr 2026 05:03PM UTC 887
67.67
9 23954362374.9 03 Apr 2026 05:03PM UTC 885
61.6
10 23954362374.10 03 Apr 2026 05:04PM UTC 885
54.92
Source Files on build 23954362374
  • Tree
  • List 887
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 492f127c on github
  • Prev Build on release/2.026.07 (#23901566613)
  • Next Build on release/2.026.07 (#24132020822)
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