Repository navigation
bug fixes #662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug fixes #662
Changes from all commits
e610661
557d7c9
faa4741
26896ef
55b2d10
f594596
af03716
2c60e79
d6e1eac
9249cf7
981a4dd
9708933
c9dcc25
91170a4
db65605
417b51f
8a03749
fdabc4f
d28900c
f0a7e36
f824c59
3466c52
9051822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1848,7 +1848,11 @@ import 'vendor_sleep.dart'; | |
| // temperature rhythm and alertness forecast use local time. Steps: the live | ||
| // pedometer counts from stride periodicity. Workouts: a 5-15 min rest with HR | ||
| // still raised stays inside one suggested workout. | ||
| const int kAlgoVersion = 119; | ||
| // 119 → 120 (gen5/MG steps): the on-chip counter answers whenever it counted | ||
| // more than the windowed live/phone sources, instead of only when they counted | ||
| // nothing, so a short tracked walk no longer hides the day's chip total. | ||
| // gen4 (no counter) is unchanged. Edge-only. | ||
| const int kAlgoVersion = 120; | ||
| /// The sibling SHAs this version was derived against, asserted against | ||
| /// pubspec.yaml in test/db_serve_version_and_reads_test.dart. | ||
| /// | ||
|
|
@@ -8661,17 +8665,23 @@ class DerivationEngine { | |
| // per record, so the day screen gets hourly `spans` off them; but adding | ||
| // it to the windowed spans would double-count every walk the other two | ||
| // already counted. So it stays a | ||
| // WHOLE-DAY FALLBACK — used only when no span source covered the day at | ||
| // all. That inversion is deliberate: whole-day precedence for this counter | ||
| // is exactly the bug being fixed (622 steps published over the phone's | ||
| // 18,856 on a day the strap synced for part of). | ||
| // WHOLE-DAY ALTERNATIVE: whichever of the two whole-day answers counted | ||
| // MORE wins. Unconditional counter precedence is the old bug (622 steps | ||
| // published over the phone's 18,856 on a day the strap synced for part | ||
| // of); "counter only when nothing else counted" was the next one: a | ||
| // 53-step manual walk hid the chip's 6,164 for the whole day. Neither | ||
| // answer adds to the other, so nothing is double-counted. | ||
| // ponytail: max undercounts a day split between disjoint sources; the | ||
| // upgrade is windowed total + counter ticks outside those windows | ||
| // (`counterTicksPerWindow`). | ||
| final strap = liveStepsFromStrap.clamp(0, liveStepsReal); | ||
| final phone = liveStepsReal - strap; | ||
| final rawBand = counter?.total; | ||
| final calibratedBand = | ||
| rawBand == null ? null : applyStepCalibration(rawBand, profile); | ||
| final useBand = | ||
| liveStepsReal <= 0 && calibratedBand != null && calibratedBand > 0; | ||
| final useBand = calibratedBand != null && | ||
| calibratedBand > 0 && | ||
| calibratedBand > liveStepsReal; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve counter steps by window. If the counter records 6,000 steps while the phone records 5,000 in a disjoint window, this selects 6,000 and discards the phone’s steps. Merge counter ticks outside the resolved windows instead of choosing one whole-day total.
|
||
| final steps = useBand ? calibratedBand : liveStepsReal; | ||
| final calibrated = useBand && profile != null && profile.isCalibrated; | ||
| final haveRealSteps = steps > 0; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.