-
Notifications
You must be signed in to change notification settings - Fork 45
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
Improved unacknowledged command recovery #139
Improved unacknowledged command recovery #139
Conversation
New resolveUnacknowledgedCommand() attempts a GetStatusCommand to resolve any unacknowledged command or throws .unacknowledgedCommandPending on failure. Have all PodCommSession funcs call resolveUnacknowledgedCommand() instead of failing if called with a pending unacknowledged command.
… code Fix deactivatePod() logic error to correctly handle an unacknowledged command Simplify logging by not including the calling function's name
Initial ReviewThe pair of PR, OmniBLE #139 and OmniKit PR 47: Improved unacknowledged command recovery, will be reviewed and tested in tandem. SummaryFor every instance in which the If the recovery succeeds, then the app continues without alerting the user. This should provide a smoother user experience. Code Review
Build Test
TestingMost of the testing will be done with OmniBLE using the rPi simulator. After that testing is completed and reported in the OmniBLE PR, an Eros pod will be tested. These test results will be provided in future comments. |
Test: Part 1This PR will take several sessions to test. These tests use the rPi DASH simulator and make use of the front-end to cause the simulator to crash after the next command is processed. Because the List of functions tested:There are 11 functions that use the
Test each in turn. Note - the changes to the pod setup process will be tested and reported in a different comment. Test Method and Results
configureAlerts
beepConfig
bolus
cancelDelivery
setTempBasal
suspendDelivery
setBasalSchedule and resumeBasal
setTime
deactivatePod acknowledgeAlerts
|
Test: Part 2Test MethodWhile developing this PR, @itsmojo developed a testing patch (OmniBLE-PR139-testing.patch) which he shared with me. I modified that patch to simplify testing of the code in this PR. This patch uses two private vars These vars can be configured between 0.0 and 1.0, inclusive. Based on the value of those parameters, the code inserts a fake error with the probability provided by that var.
In order to allow the code to keep operating when 1.0 is selected for one of these vars, I added a toggle right before those values are used in I then configured the initial values to 0.01 (or 1% failure rate) and added a set point after the toggle section and before the usage of the vars in For most of the testing below, that set point is disabled. It is only needed for commands that require 2-command (4-message) sequences that must all go through (like setTime, deactivatePod and parts of the pod initialization sequence). For all other cases, the first try for a command fails but the subsequent retry succeeds or restores app to prior state. Test comm errorsI tested each command listed below with the indicated configurations.
2-message commands If one of the fakeUncertain is set to 1.0, then first attempt fails, retry succeeds (or restores prior state). Test the commands below:
4-message commands
Special Cases
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Status
Code review: Approve
Test: Part 1: Success
Test: Part 2: Success
I approve this PR.
Fix for LoopKit/Loop#2275
Use new tryToResolvePendingCommand() function that try to use getStatus() to resolve a
pending unacknowledged command in most PodCommSession functions instead of just
failing if called with a pending unacknowledged command. Reworked logic to prevent
possible incorrect unacknowledged command handling during pod setup & deactivation.