nightscout / Trio

MIT License
45 stars 125 forks source link

exclude cancelling from bolusTrigger, comment out updateStatus #301

Closed kskandis closed 2 weeks ago

kskandis commented 2 weeks ago

This PR resolves this issue by excluding BolusState.canceling from sending a bolusTrigger.send(false) to APSManager which would tripper a bolusReporter?.removeObserver.

This is because if the bolusReporter observer is prematurely removed then the cancel completion will not be observed. APSManager separately observes CancelBolus and then will remove the bolusReporter so there is no reason to include BolusState.canceling in the trigger.

I tested this in Mock and Cancel Bolus succeeds. I also commented out updateStatus(). Once PR is tested, updateStatus() func should be removed.

marionbarker commented 2 weeks ago

The patch you posted in #265 was not successful with a rPi DASH simulator. I'm going to return to the Issue to post results in comments. I also have some more suggestions from @itsmojo for things to look at which I will also post under the issue. I definitely need and appreciate the help.