Repository navigation
Conversation
Always branch off dev, never main. Also unignore CLAUDE.md in .gitignore so instructions persist. https://claude.ai/code/session_016VQatqaNuHQ2zupY8DtZmj
CLAUDE.md is kept in .gitignore so it never appears in upstream PRs, but the hook recreates it on every fresh remote web session so project instructions (always branch off dev, never main) persist. https://claude.ai/code/session_016VQatqaNuHQ2zupY8DtZmj
Corrects the CLAUDE.md instructions the hook writes on every remote session: replaces the reference to a nonexistent SwiftLint config with the actual SwiftFormat command and rules CI enforces, plus a fallback checklist for sessions without a Swift toolchain.
Corrects the stale SwiftLint reference (this repo has no SwiftLint config) and adds an explicit lint pass before pushing a cherry-picked upstream PR branch, so 'ready' branches land already lint-clean.
Use GITHUB_RUN_NUMBER as the build number so TestFlight and the GitHub Actions run stay in sync. Fall back to latest TestFlight build + 1 when the run number is missing or not higher. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When IOB, COB, TDD, autosens, pump battery or uploader battery is absent from a device status response, show the last known value for up to 15 minutes before going blank, consistent with the existing not-looping threshold. Each field records when it was last received, so a field missing from a record that keeps arriving still expires. The grace period does not depend on the APS type, the pump clock or CGM timing. The Live Activity reads the same times, so it shows the last known value for 15 minutes and then nothing, like the info rows. Before it kept the last IOB, COB, TDD, autosens and battery values indefinitely. Add direct-value initialisers to InsulinMetric and CarbMetric so the display value can be rebuilt from a stored double. The pump reservoir is left to PumpReservoirResolver, and the recommended bolus is not carried over, since other screens use it.
MtlPhil
force-pushed
the
fix/device-status-grace-period-15min
branch
from
October 15, 2026 02:52
7f4d41a to
a914fe8
Compare
MtlPhil
marked this pull request as ready for review
October 15, 2026 02:59
MtlPhil
requested review from
bjorkert,
codebymini and
marionbarker
as code owners
October 15, 2026 02:59
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.
What this fixes
Nightscout device status responses sometimes omit fields that were present in the previous response. When that happens the info rows go blank for that refresh, so IOB, COB and the batteries flicker or disappear between updates even though the data is only a few minutes old.
Changes
For up to 15 minutes after a field was last received, the info table now shows the last known value instead of going blank. After that the row goes blank as before. 15 minutes matches the existing not-looping threshold.
Fields covered: IOB, COB, TDD, autosens, pump battery and uploader battery.
lastIOBTime,lastCOBTime,lastTddTime,lastAutosensTime,lastPumpBatteryTime,lastUploaderRecordTime), so the grace period does not depend on the APS type, the pump clock or CGM timing, and one field arriving does not keep another one alive. The Loop and OpenAPS parsers both set them.DeviceStatusGraceholds the 15 minute period and the freshness check for both.InsulinMetricandCarbMetricget direct-value initialisers so a display value can be rebuilt from a stored double.Not included
PumpReservoirResolver, which carries a reading across gaps for 30 minutes, so this PR leaves it alone.Notes
latestIOB,latestCOBand the observable battery values exactly as before.