mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
fix(measurements): file sleep sessions by span, not by night label
The SQL page labels a sleep session by the last row of any writer; the reconstruction labels it by its winning writer. A watch stopping before midnight beside a phone whose in-bed span ran past it gave two days, and matching the two by label dropped the night from the list while the total still counted it. Each reconstructed session is now filed under the page night whose span holds it and takes that night's label, which the drill-down also asks by. A sleep drill-down scans 36 hours either side of its day instead of the whole history. Both day branches and the sleep list resolve the zone through the same stored-zone resolver, so a drill-down always cuts the days its list row summed. The list description states the real page bounds: a day-sum page takes `limit` as asked, a sleep page caps at 1000 nights. Refs #1245
This commit is contained in:
1 parent
d953789ecc
commit
bf84c0c11e
5 files changed
+122
-31
No files matched your search
@@ -4204,8 +4204,9 @@ paths:
|
||||
|
||||
With `groupBy=day` on a cumulative type the rows are one sum per local day, and `limit` / `offset` page over
|
||||
those days; every returned day is complete. `type=SLEEP_DURATION` returns one row per night, paged the same way
|
||||
over nights. On both, `meta.total` counts the days or nights in the filtered window, and a page holds at most
|
||||
1000 of them (`meta.limit` echoes the value applied).
|
||||
over nights. On both, `meta.total` counts the days or nights in the filtered window. A day-sum page takes
|
||||
`limit` as asked (up to the list's 5000); a sleep page holds at most 1000 nights, and `meta.limit` echoes the
|
||||
value applied.
|
||||
parameters:
|
||||
- in: query
|
||||
name: type
|
||||
|
||||
Reference in new issue
Block a user