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

kobotoolbox / kpi / 22689698406 / 1
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 04 Mar 2026 09:52PM UTC
Files 884
Run time 20s
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

04 Mar 2026 09:16PM UTC coverage: 78.926% (-2.3%) from 81.226%
22689698406.1

push

github

web-flow
fix(reports): sanitize non-finite floats to prevent invalid JSON responses DEV-1797 (#6779)

### 📣 Summary

Fixed an issue where the reports page would fail to load when a decimal
field contained a non-finite value (e.g. `Infinity` or `NaN`) in a
submission.

Also fixes the statistics computation so that submissions containing
non-finite decimal values are treated as **not provided**, rather than
corrupting counts and aggregates.

### 📖 Description

When a submission contains `Infinity` or `NaN` for a decimal field, two
problems occur:

1. **Invalid JSON response (this PR):** The backend statistics
computation (mean, median, stdev, mode) can produce non-finite float
values. These are not valid JSON, causing `JSON.parse` in the browser to
fail and the reports page to display an error. Fixed by introducing a
`SanitizedJSONRenderer` that recursively replaces any non-finite float
(`NaN`, `Infinity`, `-Infinity`) with `null` before serializing the HTTP
response.

2. **Incorrect statistics
([formpack#340](https://github.com/kobotoolbox/formpack/pull/340)):**
`NumField.parse_values()` was silently passing non-finite floats
through, causing them to be counted as valid provided responses and
corrupting `provided`, `total_count`, and aggregate statistics (mean,
median, etc.). Fixed upstream by raising a `ValueError` for non-finite
floats — the existing `_calculate_stats` error handler already treats
these as `not_provided`. This PR bumps the formpack dependency to
include that fix.

7082 of 11477 branches covered (61.71%)

27175 of 34431 relevant lines covered (78.93%)

0.79 hits per line

Source Files on job 22689698406.1
  • Tree
  • List 884
  • Changed 31
  • Source Changed 0
  • Coverage Changed 31
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 22689698406
  • a820435b on github
  • Prev Job for on release/2.026.03 (#22679869904.2)
  • Next Job for on release/2.026.03 (#22698922805.2)
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