Repository navigation
fix(cbio): name the sensor counter a counter, not a clock - #171
Closed
shroominic wants to merge 1 commit into
Closed
shroominic wants to merge 1 commit into
shroominic wants to merge 1 commit into
Conversation
The archive documented the field as 'Sensor-recorded epoch seconds' and exposed it through oldestTime/newestTime. It is the batch base plus 60 per record: an epoch-less position that advances exactly one step per stored record, so a surface that renders it as HH:mm reports ingest position and calls it a wall clock. Name it for what it is. oldestSensorCounter/newestSensorCounter replace the time-shaped getters, the field docs say it is not Unix time and cannot yield a clock without the sensor activation time, and a regression test pins the one-step-per-record relationship and fails if either old name comes back. Refs #146
Owner
Author
|
Not absorbed by the GS1 consolidation (#209, feature/cbio-gs1). Left open on purpose so the naming defect is not silently dropped: the epoch-less counter naming is not in the consolidated tree - |
Owner
Author
|
Carried into #209 (head
#146 closes when #209 lands on |
This was referenced Sep 18, 2026
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 #146.
The defect
The archive called the
08batch's second counter "Sensor-recorded epochseconds" and exposed it as
oldestTime/newestTime. From #146's arithmetic:The counter advances exactly one step per stored record, so anything that turns
it into
HH:mmreports the ingest position and calls it a clock. The rendered+7h28mskew is the per-record counter, not UTC.The fix
oldestTime/newestTimebecomeoldestSensorCounter/newestSensorCounter. The time-shaped names were the invitation to build aDateTimefrom it.CbioRawGlucoseRecord.rawTimeandCbioPackedRecord.rawTimeare documentedas the epoch-less per-record counter, explicitly not Unix time, and explicitly
not derivable into a clock without the sensor's activation time.
60 * (records - 1)) andfails if either removed name comes back.
Verification
packages/cgm_cbio:flutter test61 passed;flutter analyzeclean;dart format --set-exit-if-changed lib testclean.Scope note
This lane removes the trap at the source. The downstream rendering fix - the
session no longer inventing a timestamp (
recordedAt: null) and the heroreporting the protocol position instead - lives in the live-session branch
(#142), which #146 already documents.