Skip to content
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: Old suggestions keep getting used in Bolus Calculator #185

Open
trixing opened this issue Mar 8, 2022 · 0 comments
Open

Bug: Old suggestions keep getting used in Bolus Calculator #185

trixing opened this issue Mar 8, 2022 · 0 comments

Comments

@trixing
Copy link
Contributor

trixing commented Mar 8, 2022

I have run into an issue where the sensor expired and didn't deliver new CGM values. The latest suggestion by determineBasal stuck around though and was never cleared because the determineBasal() function in APSManager.swift errors out early if glucose is too old. It should in that case reset the suggestion to 0 and publish to observer (I think).

If we don't do this, the Bolus calculator will happily keep using the old suggestion as setupInsulinRequired in BolusStateModel.swift doesn't care to check how recent the suggestion is. In terms in defense in depth it would probably good to always require a fresh determineBasal run in the BolusCalculator before recommending any values? Or at least it should check that the suggestion isn't older than a few minutes and no bolus has been issued since the last time it was opened. Maybe initiating a Bolus should also clear the latest suggestion?

bjornoleh pushed a commit to bjornoleh/freeaps that referenced this issue Aug 24, 2022
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

No branches or pull requests

1 participant