Repository navigation
fix(cbio): finish a holed history and give the stored range a real window - #206
Closed
shroominic wants to merge 1 commit into
Closed
shroominic wants to merge 1 commit into
shroominic wants to merge 1 commit into
Conversation
Two halves of G5, both about the same question: what does the GS1 surface actually know. `inProgress` reported "the range is contiguous" instead of "there is more of what the sensor pushed still coming", because `_atLiveEdge` returned false whenever `CbioHistoryArchive.hasGap` was set. One missing position therefore pinned a finished fetch to "Fetching sensor history" for the rest of the session. A close on the settle (idle) timer is the counter-free evidence that the sensor stopped offering, so it now answers that question on its own; a deadline close still falls back on the freshness check, which uses the anchored instant when the session holds one. The hole stays visible in the positions the session publishes and in the caption. The stored-history caption gains the real window and the holes: the anchor turns the stored range into local times (`02:34–19:02`) and the range reports the positions that never arrived (`3 positions not received`). Without an anchor the caption is unchanged - count and sensor minutes only, next to the unsynced line. Refs #195. Tests: cgm_cbio 92 passed (2 skipped), openhealth 487 passed; `flutter analyze` clean in both, including `openhealth/integration_test`.
shroominic
force-pushed
the
fix/cbio-history-live-edge
branch
from
September 18, 2026 09:25
217aa50 to
f0cb0ff
Compare
shroominic
changed the base branch from
feature/cbio-index-time-anchor
to
feature/cbio-gs1-app-live
September 18, 2026 09:25
This was referenced Sep 18, 2026
Owner
Author
|
Carried by the GS1 consolidation in PR #209 (branch feature/cbio-gs1, head 3eca4f4). This PR is contained in the consolidated line; the merge that carries it is 50fa6c7. Closing as subsumed by the consolidation - not as won't fix. The per-defect evidence stays in this thread, and the carrying commit above is where the change now lives. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #195. Both halves of G5, stacked on #197 (
feature/cbio-index-time-anchor) because the caption's real window comes from the anchor that PR adds. Base will move tofeature/cbio-gs1-app-liveonce #197 lands; the stacked diff is only this PR's two files plus the docs.Half 1 - a holed history never finished ingesting
CbioGlucoseSession._atLiveEdgereturned false wheneverCbioHistoryArchive.hasGapwas set, and_historySyncState.inProgresswas!atLiveEdge || _catchUpOpen. One missing position pinned a finished fetch to"Fetching sensor history" for the rest of the session.
inProgressnow answers one question: is there more of what the sensor pushedstill coming. A close on the settle (idle) timer is the counter-free evidence
that the sensor stopped offering, so that alone answers it; a deadline close
still falls back on the freshness check, which uses the anchored instant when
the session holds one (and only then the bare counter, as a freshness check,
never as a rendered clock). The hole stays visible in the positions the session
publishes and in the caption.
RED, on the base of this branch:
GREEN: the same capture (positions 1-3, a hole at 4, then 5 at the live edge)
reaches
stage: readywithinProgress: false, and the published positions arestill
1, 2, 3, 5.Half 2 - the range gets a real window and shows its holes
cbioStoredRangeTextnow takes the snapshot's anchor:3 readings stored · sensor minutes 10065–10067 · 10:03–10:05with thewindow in the device's local zone (the test asserts it against
DateFormat('HH:mm').format(instant.toLocal()));… · 1 position not receivedwhen the stored positions span a hole;minutes, next to the unsynced line from feat(cbio): anchor the GS1 record index to the clock the app set #197.
Verification
dart formatclean on every new or touched line (the lane's pre-existing drifthunks in
main.dartandcbio_glucose_session_test.dartare unchanged - theformatter diff against those files is identical to the base's).
Not touched
The five lane PRs still awaiting the
05785b0rebase (#175, #177, #182, #186,#188) - not edited, comment only. CI's known reds are unchanged and pre-existing.