mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
Systolic, diastolic and the cuff's pulse are three rows with no link column, and the single DELETE tombstoned only the row it was given, so deleting a reading's systolic left its diastolic and pulse behind as half a reading. The bulk delete had the same gap. A reading is the rows with the same owner, the same source and the identical measuredAt: that is how the entry form, the MCP write, a Withings measure group and a HealthKit correlation all store one, and how the FHIR read pairs a diastolic onto its systolic. The looser five-minute pairing of the chart reads is right for drawing a point and wrong for taking rows away. Deleting a systolic or diastolic now tombstones the rest of its reading in the same transaction with the same deletedAt, each row with its own syncVersion bump so paired clients see every tombstone. The restore route brings back the rows deleted together with a named half (identical deletedAt), so the undo, which names only the row that was tapped, puts the whole reading back, from the web list and from any client that calls it the same way. A pulse is still deleted on its own, and a row deleted at another moment stays deleted. The response shapes do not change; the OpenAPI descriptions say what the counts now include.
3.3 MiB
3.3 MiB