Skip to content

Fix basal and user mode durations being truncated in auto-update mode - #139

Open
egyptianbman wants to merge 1 commit into
jwoglom:masterfrom
egyptianbman:basal-duration
Open

Fix basal and user mode durations being truncated in auto-update mode#139
egyptianbman wants to merge 1 commit into
jwoglom:masterfrom
egyptianbman:basal-duration

Conversation

@egyptianbman

Copy link
Copy Markdown
Contributor

Basal and user mode durations were being reported as zero when polling frequently because the final event in a sync batch was being capped at its own timestamp. This rendered active therapy and device modes invisible in Nightscout until subsequent data arrived.

Extending active event durations to the actual synchronization time and enforcing a minimum visibility threshold ensures that ongoing pump states are accurately represented and visible in the UI between polling cycles. Using total seconds and rounding improves data robustness and prevents excessive float precision in the uploaded entries.

With 180s --auto-update, before:
image

after:
image

Basal and user mode durations were being reported as zero when polling
frequently because the final event in a sync batch was being capped at
its own timestamp. This rendered active therapy and device modes invisible
in Nightscout until subsequent data arrived.

Extending active event durations to the actual synchronization time and
enforcing a minimum visibility threshold ensures that ongoing pump states
are accurately represented and visible in the UI between polling cycles.
Using total seconds and rounding improves data robustness and prevents
excessive float precision in the uploaded entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant