Skip to content

v2.0.2

Latest

Choose a tag to compare

@ilyakruchinin ilyakruchinin released this 06 Sep 11:08
· 3 commits to main since this release

πŸ“‹ 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 FatFS f_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/days to 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.json reading with an ultra-fast single-pass buffer parser in oximetry_canonical_list_ready().
  • πŸ”„ Zero-Overhead Upload Scheduling:
    Replaced the synchronous card-wide directory crawl in upload_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-smb and POST /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.

πŸ›‘οΈ Data Integrity & Robustness

  • 🩺 CPAP Session Clamping & Corruption Prevention:
    Hardened edf_summary.c by clamping mask session boundaries strictly to [0, 1440] daily minutes instead of dropping valid therapy minutes or allowing out-of-range timestamps into STR.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.

πŸ§ͺ 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 pipefail and output parsing in the test runner step so test failures behind tee properly fail the CI build as intended.
    • Contributed by @Plantucha.
  • ⏰ AS11 Time Formatter Coverage (PR #210):
    Added comprehensive unit test coverage (Scenario 12 in scripts/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).

🧹 Refactoring & Minor Improvements

  • πŸ”‡ Log Level Demotion for Skipped STR Windows (PR #209):
    Lowered the log level for skipped out-of-day STR windows from WARNING to INFO to keep logs clean and calm during full EDF rebuilds.
  • πŸ“¦ Header Cleanups:
    Updated upload_index.h to 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.