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

kobotoolbox / kpi / 25747273888

12 May 2026 04:17PM UTC coverage: 82.179% (+0.008%) from 82.171%
25747273888

push

github

web-flow
fix(exports): prevent simultaneous identical exports DEV-2021 (#7028)

### đŸ“Ŗ Summary
Identical duplicate API export requests are now intercepted and
deduplicated. Instead of creating a new background Celery task, the API
queries for an identical running export task belonging to the same user
and returns it seamlessly to the frontend.

### 📖 Description
Previously, if the frontend (or a script) blindly retried this POST
request with the exact same JSON payload before the first export
finished, the system would make another background Celery task with the
same parameters. The new implementation within
`ExportTaskSerializer.create()` fixes this by first checking the
database for any active SubmissionExportTask belonging to the current
user that has an identical data payload (ensuring the configurations
like fields, group_sep, type, etc., match exactly). If a matching task
is found that is still in a CREATED or PROCESSING state, the serializer
bypasses database creation and returns the existing task. This allows
the frontend to continue polling the original task gracefully without
duplicating the task and wasting resources.


### 👀 Preview steps

1. â„šī¸ have an account and a project
2. Simulate a long export by adding `time.sleep(30)` to the method
`SubmissionExportTask,_run_task` at
`/kpi/kpi/models/import_export_task.py`
3. Export the project data
4. within 30 seconds, duplicate your browser tab and export the data
again with the same export configuration
5. 🔴 [on main] notice that this creates a duplicated export task
6. đŸŸĸ [on PR] notice that this doesn't create a duplicated export task

8980 of 12047 branches covered (74.54%)

16 of 37 new or added lines in 2 files covered. (43.24%)

1635 existing lines in 100 files now uncovered.

29661 of 36093 relevant lines covered (82.18%)

5.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.66
/kpi/utils/query_parser/query_parser.py


Source Not Available

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