๐ Changelog
All notable changes to SomnoTrace since release v2.0.1.
๐ [v2.0.2] - 2026-09-06
๐ Highlights: Web Portal & API Performance Revolution
The web dashboard and API layer received a major performance overhaul, slashing load times from several sluggish seconds down to virtually instantaneous! โก๐จ
- โก ~40x Faster System Status (
/api/status):
Response times plummeted from ~2,060 ms โ ~52 ms! ๐๏ธ๐จ The blocking FatFSf_getfree()cluster crawl is now offloaded to an asynchronous background worker (sd_refresh_task) that caches SD capacity with a 10-minute refresh cadence, eliminating the multi-second synchronous freeze on every status poll. - โฑ๏ธ Up to 50x Faster Oximetry Data Queries:
- ๐
Added
GET /api/oximetry/daysto retrieve all available calendar dates in ~40 ms by inspecting directory names directly without opening a single file! - ๐ฏ Implemented server-side day scoping via
GET /api/oximetry/recordings?date=YYYYMMDD, cutting recording fetch times from 930โ3,600 ms down to ~72 ms on SD cards with extensive historical data. - โก Optimized
recording.jsonreading with an ultra-fast single-pass buffer parser inoximetry_canonical_list_ready().
- ๐
Added
- ๐ Zero-Overhead Upload Scheduling:
Replaced the synchronous card-wide directory crawl inupload_sched_summary()with an in-memory atomic counter (upload_ox_cached_pending()), banishing SD card lock contention during dashboard updates. - ๐ 7x Faster Concurrent Page Ready Time:
Overall dashboard initialization wall time dropped from ~2,890 ms to ~404 ms โ graphs and stats now snap onto the screen almost immediately! ๐ - ๐ค Deferred Log History Streaming:
The portal now delays fetching log history until you actually click into the "Logs" tab, avoiding unnecessary network and CPU load during initial startup. - ๐ฃ๏ธ Expanded HTTP Route Table:
Increased HTTP server URI handler capacity to 128 (max_uri_handlers = 128), resolving route table overflow and silencing those annoying spurious 404 warnings on/api/summary.
โจ New Features
- ๐ SMB & SleepHQ Connection Testing (PR #211):
Added interactive "Test connection" buttons to the Web Portal settings cards for both SMB and SleepHQ! ๐งโ๏ธ- Backed by two new endpoints:
POST /api/uploads/test-smbandPOST /api/uploads/test-sleephq. - Safely probes credentials, network availability, and remote directory paths without transferring files, modifying scheduler state, or leaking OAuth tokens.
- Protected with busy checks against active upload runs.
- Contributed with โค๏ธ by @Plantucha.
- Backed by two new endpoints:
๐ก๏ธ Data Integrity & Robustness
- ๐ฉบ CPAP Session Clamping & Corruption Prevention:
Hardenededf_summary.cby clamping mask session boundaries strictly to[0, 1440]daily minutes instead of dropping valid therapy minutes or allowing out-of-range timestamps intoSTR.edf. This prevents false "corrupted SD card" errors in OSCAR while fully preserving therapy minutes across noon day boundaries (addressing discussion #185).- Backed by 6 comprehensive unit tests in
scripts/edf_properties_test.c! ๐งช - Optimisation idea provided by @Plantucha.
- Backed by 6 comprehensive unit tests in
๐งช Automated Testing & CI
- ๐ค Host Test CI Automation (PR #212):
Added an automated GitHub Actions CI workflow to run the entire host test suite on every push and pull request, keeping code quality locked tight.- Configured
pipefailand output parsing in the test runner step so test failures behindteeproperly fail the CI build as intended. - Contributed by @Plantucha.
- Configured
- โฐ AS11 Time Formatter Coverage (PR #210):
Added comprehensive unit test coverage (Scenario 12 inscripts/as11_time_test.c) validating EDF datetime, recording ID, and session directory formatters across timezone conversions, DST transitions, and boundary years (including leap year 2100).- Contributed by @Plantucha.
๐งน Refactoring & Minor Improvements
- ๐ Log Level Demotion for Skipped STR Windows (PR #209):
Lowered the log level for skipped out-of-day STR windows fromWARNINGtoINFOto keep logs clean and calm during full EDF rebuilds.- Contributed by @Plantucha.
- ๐ฆ Header Cleanups:
Updatedupload_index.hto refine header structure and interface definitions.
๐ฅ Contributors & Kudos
Huge thanks to the awesome contributors who helped make this release shine:
- ๐ @Plantucha (Michal Planicka) for contributing the SMB/SleepHQ connection test suite (PR #211), CI host test automation (PR #212), AS11 datetime formatter test coverage (PR #210), and STR logging cleanup (PR #209).
- ๐ @ilyakruchinin (Ilya Kruchinin) for the massive Web UI and HTTP server performance overhaul, implementation of mask session boundary clamping, and core architecture.