mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-08-27 22:34:14 +00:00
The WebConfig POST/result/reboot/stop batch state machine was the largest remaining Phase 6 coverage gap (all inline in WebConfigServer.cpp, coupled to AsyncWebServer/ArduinoJson and untestable on host). Extract its decision + timing CORE into a pure, dependency-free spec mirroring MQTTLifecycle.h: - src/helpers/WebConfigBatch.h: classifyPost (replay/busy/accept/no-changes with the DONE-vs-PENDING reqid asymmetry), drain pacing (signed 25 ms gate, sticky all_ok, 30 s reboot fallback), result classification + arm-once 3 s reboot, signed-wrap-safe reboot-due / isRebootPending, and stop gating (finalize when refs==0, warn-once, never force teardown). Constants verbatim from the source. - test/test_webconfig_batch/: full host coverage incl. exact boundaries and millis() rollover. Spec-first, exactly like Phase 4's MQTTLifecycle.h: this is NOT yet wired into WebConfigServer.cpp. That server is hardware-tuned (debugged against real iOS captive-portal + HTTP-caching + route-ordering behavior), so making the spec load-bearing is a deliberately separate, hardware-validated follow-up. Faithfulness independently reviewed against WebConfigServer.cpp; native suite green (14 dirs). No production behavior change.