mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 22:32:04 +00:00
A parity walk over POST /api/workouts/batch: a mixed first batch with every per-entry refusal and the cross-source twin, the same batch with an enrichment, a corrected hand entry, a kept track, both whole-batch refusals and a narrow bridge token. Responses, wide events, queue tails and stored workouts with their series and tracks are pinned.
285 lines
6.4 KiB
Plaintext
285 lines
6.4 KiB
Plaintext
{
|
|
"status": 200,
|
|
"body": {
|
|
"data": {
|
|
"processed": 8,
|
|
"inserted": 5,
|
|
"duplicates": 1,
|
|
"skipped": [
|
|
{
|
|
"index": 5,
|
|
"reason": "unstable_external_id"
|
|
},
|
|
{
|
|
"index": 6,
|
|
"reason": "invalid_samples"
|
|
}
|
|
],
|
|
"entries": [
|
|
{
|
|
"index": 0,
|
|
"status": "inserted"
|
|
},
|
|
{
|
|
"index": 1,
|
|
"status": "inserted"
|
|
},
|
|
{
|
|
"index": 2,
|
|
"status": "inserted"
|
|
},
|
|
{
|
|
"index": 3,
|
|
"status": "inserted"
|
|
},
|
|
{
|
|
"index": 4,
|
|
"status": "duplicate"
|
|
},
|
|
{
|
|
"index": 5,
|
|
"status": "skipped",
|
|
"reason": "unstable_external_id"
|
|
},
|
|
{
|
|
"index": 6,
|
|
"status": "skipped",
|
|
"reason": "invalid_samples"
|
|
},
|
|
{
|
|
"index": 7,
|
|
"status": "inserted"
|
|
}
|
|
]
|
|
},
|
|
"error": null
|
|
},
|
|
"events": [
|
|
{
|
|
"status": 200,
|
|
"action": {
|
|
"name": "workout.batch.ingest"
|
|
},
|
|
"meta": {
|
|
"write_bucket": "own",
|
|
"external_id_rejected": 1,
|
|
"external_id_shapes": "object_description",
|
|
"external_id_surface": "workout.batch",
|
|
"pr_detection_enqueued": true,
|
|
"pr_detection_silent": false,
|
|
"processed": 8,
|
|
"inserted": 5,
|
|
"duplicates": 1,
|
|
"enriched": 0,
|
|
"updated": 0,
|
|
"skipped": 2,
|
|
"routes_dropped": 1
|
|
},
|
|
"warnings": null,
|
|
"error": null
|
|
}
|
|
],
|
|
"effects": [
|
|
{
|
|
"effect": "enqueuePrDetection",
|
|
"args": [
|
|
"<id:1>",
|
|
{
|
|
"silent": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"effect": "emitDataArrival",
|
|
"args": [
|
|
{
|
|
"userId": "<id:1>",
|
|
"kind": "workout",
|
|
"newestSampleAt": "2026-10-14T06:30:00.000Z",
|
|
"insertedCount": 1,
|
|
"refId": "<id:2>",
|
|
"source": "batch"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"effect": "emitDataArrival",
|
|
"args": [
|
|
{
|
|
"userId": "<id:1>",
|
|
"kind": "workout",
|
|
"newestSampleAt": "2026-10-13T16:00:00.000Z",
|
|
"insertedCount": 1,
|
|
"refId": "<id:3>",
|
|
"source": "batch"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"effect": "emitDataArrival",
|
|
"args": [
|
|
{
|
|
"userId": "<id:1>",
|
|
"kind": "workout",
|
|
"newestSampleAt": "2026-10-12T18:00:00.000Z",
|
|
"insertedCount": 1,
|
|
"refId": "<id:4>",
|
|
"source": "batch"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"effect": "emitDataArrival",
|
|
"args": [
|
|
{
|
|
"userId": "<id:1>",
|
|
"kind": "workout",
|
|
"newestSampleAt": "2026-10-11T07:00:00.000Z",
|
|
"insertedCount": 1,
|
|
"refId": "<id:5>",
|
|
"source": "batch"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"effect": "emitDataArrival",
|
|
"args": [
|
|
{
|
|
"userId": "<id:1>",
|
|
"kind": "workout",
|
|
"newestSampleAt": "2026-10-08T07:00:00.000Z",
|
|
"insertedCount": 1,
|
|
"refId": "<id:6>",
|
|
"source": "batch"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"stored": [
|
|
{
|
|
"id": "<id:6>",
|
|
"sportType": "running",
|
|
"startedAt": "2026-10-08T07:00:00.000Z",
|
|
"endedAt": "2026-10-08T07:50:00.000Z",
|
|
"durationSec": 3000,
|
|
"totalEnergyKcal": null,
|
|
"totalDistanceM": null,
|
|
"avgHeartRate": null,
|
|
"maxHeartRate": null,
|
|
"minHeartRate": null,
|
|
"stepCount": null,
|
|
"elevationM": null,
|
|
"pauseDurationSec": null,
|
|
"source": "APPLE_HEALTH",
|
|
"externalId": "hk-run-2",
|
|
"externalSourceVersion": null,
|
|
"metadata": null,
|
|
"samples": null,
|
|
"route": null
|
|
},
|
|
{
|
|
"id": "<id:5>",
|
|
"sportType": "swimming",
|
|
"startedAt": "2026-10-11T07:00:00.000Z",
|
|
"endedAt": "2026-10-11T07:40:00.000Z",
|
|
"durationSec": 2400,
|
|
"totalEnergyKcal": null,
|
|
"totalDistanceM": 1500,
|
|
"avgHeartRate": null,
|
|
"maxHeartRate": null,
|
|
"minHeartRate": null,
|
|
"stepCount": null,
|
|
"elevationM": null,
|
|
"pauseDurationSec": null,
|
|
"source": "APPLE_HEALTH",
|
|
"externalId": "hk-swim-1",
|
|
"externalSourceVersion": null,
|
|
"metadata": null,
|
|
"samples": null,
|
|
"route": null
|
|
},
|
|
{
|
|
"id": "<id:4>",
|
|
"sportType": "walking",
|
|
"startedAt": "2026-10-12T18:00:00.000Z",
|
|
"endedAt": "2026-10-12T18:30:00.000Z",
|
|
"durationSec": 1800,
|
|
"totalEnergyKcal": null,
|
|
"totalDistanceM": null,
|
|
"avgHeartRate": null,
|
|
"maxHeartRate": null,
|
|
"minHeartRate": null,
|
|
"stepCount": null,
|
|
"elevationM": null,
|
|
"pauseDurationSec": null,
|
|
"source": "MANUAL",
|
|
"externalId": null,
|
|
"externalSourceVersion": null,
|
|
"metadata": null,
|
|
"samples": null,
|
|
"route": null
|
|
},
|
|
{
|
|
"id": "<id:3>",
|
|
"sportType": "cycling",
|
|
"startedAt": "2026-10-13T16:00:00.000Z",
|
|
"endedAt": "2026-10-13T17:00:00.000Z",
|
|
"durationSec": 3600,
|
|
"totalEnergyKcal": null,
|
|
"totalDistanceM": 24000,
|
|
"avgHeartRate": null,
|
|
"maxHeartRate": null,
|
|
"minHeartRate": null,
|
|
"stepCount": null,
|
|
"elevationM": null,
|
|
"pauseDurationSec": null,
|
|
"source": "MANUAL",
|
|
"externalId": "manual:ride-1",
|
|
"externalSourceVersion": null,
|
|
"metadata": null,
|
|
"samples": null,
|
|
"route": null
|
|
},
|
|
{
|
|
"id": "<id:2>",
|
|
"sportType": "running",
|
|
"startedAt": "2026-10-14T06:30:00.000Z",
|
|
"endedAt": "2026-10-14T07:15:00.000Z",
|
|
"durationSec": 2700,
|
|
"totalEnergyKcal": 610,
|
|
"totalDistanceM": 8200,
|
|
"avgHeartRate": 148,
|
|
"maxHeartRate": 171,
|
|
"minHeartRate": null,
|
|
"stepCount": null,
|
|
"elevationM": null,
|
|
"pauseDurationSec": null,
|
|
"source": "APPLE_HEALTH",
|
|
"externalId": "hk-run-1",
|
|
"externalSourceVersion": null,
|
|
"metadata": {
|
|
"HKIndoorWorkout": false
|
|
},
|
|
"samples": {
|
|
"samples": [
|
|
{
|
|
"t": "2026-10-14T06:30:00.000Z",
|
|
"hr": 121
|
|
},
|
|
{
|
|
"t": "2026-10-14T06:30:05.000Z",
|
|
"hr": 128,
|
|
"cadence": 168
|
|
},
|
|
{
|
|
"t": "2026-10-14T06:30:10.000Z",
|
|
"hr": 133
|
|
}
|
|
],
|
|
"sampleCount": 3
|
|
},
|
|
"route": null
|
|
}
|
|
]
|
|
}
|