mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Both ends of this defect had passing tests for the whole time it was broken. The section builder returned the symptoms, the wire schema declared them, the restore read them, and each of those three was covered on its own. Nothing covered the object literal in between, which copied section keys out one at a time and never listed `customSymptoms`. So the test spans the seam and asserts on rows. It populates an account with a symptom of its own on a day-log, builds the file through the real `buildFullBackupPayload`, serialises it, parses it back through the real `parseBackupPayload`, and drives the real admin restore. Asserting that the payload carries the field would only re-test the writer that was already green. Deleting the symptom row before the restore is the case the field exists for, not a contrivance: `restoreCycleData` clears day-logs, cycles, and the profile but never the symptom catalogue, so a restore onto the same instance still finds the row sitting there. That is why the older round-trip test stayed green through the whole thing. Mutation check: hand-pick the cycle section's keys again and the restore answers 500 on `Unknown cycle symptom keys: custom:sacroiliac-ache`, which is the production failure verbatim.