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

akvo / african-bamboo-dashboard / 34233127375
92%

Build:
DEFAULT BRANCH: main
Ran 08 Sep 2026 01:40PM UTC
Jobs 1
Files 48
Run time 1min
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 Sep 2026 01:34PM UTC coverage: 92.387% (+0.02%) from 92.369%
34233127375

push

github

ifirmawan
[#51] fix(sync): scope submission uuid to its form for cloned Kobo assets

Syncing form aXE8NU3f8HrXmC5FL96HoD returned 500 in production:

  IntegrityError: duplicate key value violates unique constraint
  "submissions_uuid_key"
  DETAIL: Key (uuid)=(d5a54017-216c-404c-a283-31bc879fccf6) already exists.

Submission.uuid was globally unique while _upsert_submission looks up
by (form, kobo_id). Kobo's _uuid identifies a submission within an
asset, not globally: cloning a project copies submissions with their
original _uuid under fresh _id values. Syncing the clone therefore
tried to insert a uuid the origin form already owned. This surfaced
now because it is the first clone to be synced; _upsert_submission
itself is unchanged since e2e5b85.

Drop the global constraint, add unique_together (form, uuid). Existing
data needs no repair -- the old constraint guaranteed there were no
violations to fix.

Scoping uniqueness makes a bare /submissions/<uuid>/ ambiguous once two
clones exist, so the lookups that assumed global uniqueness are handled
rather than left to raise MultipleObjectsReturned:

- SubmissionViewSet.get_object narrows by ?asset_uid= and answers 409
  ambiguous_submission when the uuid still matches more than one form.
  Silently returning whichever row sorted first would show the wrong
  form's data, or apply a validator's approve/reject to it.
- download_submission_attachments takes an optional asset_uid, optional
  so tasks queued before this change still run.
- The frontend sends asset_uid on all eight submission requests.
  plot.form_id already carries the asset_uid, so no serializer change
  was needed. This also fixes a latent bug: the detail panel's fetch
  keyed only on submission_uuid, so switching between two plots that
  share a uuid would not have refetched.

The 409 body carries error_type, matching kobo_unauthorized and
missing_from_kobo, so callers can discriminate without string matching.

tests_cloned_form_submissions.py cove... (continued)

26 of 27 new or added lines in 3 files covered. (96.3%)

3859 of 4177 relevant lines covered (92.39%)

0.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
93.02
-0.21% backend/api/v1/v1_odk/tasks.py
Jobs
ID Job ID Ran Files Coverage
1 34233127375.1 08 Sep 2026 01:40PM UTC 48
92.39
GitHub Action Run
Source Files on build 34233127375
  • Tree
  • List 48
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34233127375
  • 7d2b44ca on github
  • Prev Build on main (#34218382962)
  • Next Build on main (#34237091906)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc