kvs-coder / health_kit_reporter

A Flutter wrapper for the HealthKitReporter library
https://pub.dev/packages/health_kit_reporter
MIT License
38 stars 38 forks source link

Can't import a workout if it is not entirely in the predicate time range #66

Closed SamBergeron closed 9 months ago

SamBergeron commented 1 year ago

Describe the bug Currently there is no way to import a workout that is not explicitly inside the predicate time range.

To Reproduce Create a workout in Apple health, starting at 11:30pm and ending at 12:30 am the next day Create a predicate for the starting day from 12:00 to 12:00 the next day. The workout is not imported. The workout is also not imported if you do the same thing for the next day.

i.e if you import on 24hr increments for a day, and you workout overlaps you cannot import it in any day whatsoever because import logic is strict. The workout start time and end time must be included entirely in the predicate range.

Expected behavior You are able to import an overlapping workout

Additional context Native healthkit exposes "options" you can pass to samples query but those options are not available in the flutter plugin, so there's nothing we can do about it. I've coded a PR for this I will link to