-
Notifications
You must be signed in to change notification settings - Fork 514
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
Port over pump loss fix via LoopKit/Loop#1702 #277
Conversation
Co-authored-by: kskandis <kskandis@users.noreply.github.com>
I tried with iphone 8 + RPI Dash simulator with last code :
|
Problems with PR:I think we are missing something. I believe this should remember the pump when going from dev to the new branch (but the reverse should not be true.) (Error 1) Also, with the PR in place, deleting the insulin delivery system doesn't seem to get rid of it. (Error 2) This is for Omnipod ONLY. Did not happen for Medtronic. ConfigurationNoticed the transition problem - which I thought was wrong. Testing - DASH simulator
Testing - Medtronic
|
Succesful test:Not fresh install, various branches had been build in the past, but:
Testing in reverse, going from pump-loss-fix-migration to dev, the pod was lost (and the sim pump had been automatically selected for some reason). |
Thank you for your thorough testing!
This issue pre-exists in dev, too, so it isn't related to this PR. We should open a separate issue for it? For other issues, I think once this PR is installed on the iPhone, the nlist pump state persists and will be the first choice as the method of retrieval. So changing pump state on a Dev installation will not be supported once this PR is installed. Is this the way Loop also works? Loop does have ResetLoopManager which gets called from LoopAppManager on launch. We could use this to clear nlists documents for testing. |
Can only join @kskandis and thank you all for rigid testing (and even burning pods). Thank you! To address the feedback and question: The expected behaviour should be
It looks like that @marionbarker seems to have lost the pod (rPi) on both cases, while @bjornoleh's test showed the expected behaviour. I'm unsure how to proceed here. @marionbarker can you please check if this may be a UI glitch, where the home screen shows no pump ("Add pump"), but when you tap it, it is actually already connected? I have experienced this behaviour with the in-app simulator before and reported it on Discord (no issue so far); just to make sure if the actual pairing is lost, or if the UI just is not updated properly. |
Failure during testing:
|
@kskandis and I will be looking at this more closely and be working towards a solution hopefully later today. I think it's fair to summarize: we've encountered two issues here (which we will look at):
|
…ts method to delete pump state used for testing only
* revert get and clean property value to original * add resetLoopDocuments method to delete pump state used for testing only
With the recent changes introduced by @kskandis I can now report the following: I can now successfully
I've force closed, restarted phone, rebuild feature branch multiple times, pod stays paired. Ultimately, pod persists going from dev -> feature; is lost feature -> dev; works as designed. Tested with rPi pod simulator on an iPhone 11 running iOS 16.7. There is also a (temporary ❓ ) debug feature to clean the binary files for paired pumps hidden under the debug toggle. This cleans out the files; may be useful for testing this PR and possibly beyond. |
StatusSuccess for Omnipod DASH
This comment has gotten pretty long. Do the Medtronic testing in a new comment. Configuration
Testing - DASHTest 1: Success: pod maintained going from dev to fix
Test 2: Success: pod lost going from fix to dev
Test 3A: Fail: pod NOT maintained going from dev to fix
Test 3B: Success - fix works for all pod commands
Test 4: Success: Try the dev to fix transition againWhen this was done for Loop, you had to delete the app to go backwards.
Test 5: repeat the dev - fix testTry again building dev over fix without deleting first, then return to fix
|
StatusMDT Test #1 a success. Will do the rest of the MDT testing later. Configuration
Testing - MedtronicTest 1: Success: MDT maintained going from dev to fix
Need to take a break. I'll do the return to dev testing for MDT later. I'll leave the test phone running closed loop with MDT and fix branch running. |
Thanks for your detailed comments and testing!!
In the case where you are moving from PR to Dev, you should use the new Settings - Debug Option "Delete Pump State nlist" Button to remove the persistent nlist doc. Otherwise when you re-install the PR, it will still exist and the PR will use that (rather than the legacy, Dev pump settings) for the pump setttings. I'm very sorry if I did not explain the Debug Option fully. This is why we need this option, if only temporarily for testing. |
Tested with simulator with success. But probably to remove when merged because no reason to open this option...avoid to delete plist associated with a pump without any reason... |
You only need to use the debug reset functionality if you return back to Dev after installing PR, and then, re-installing PR, so multiple round trips of installation which would a user would not do. I know confusing! Dev -> PR -> Dev -> PR, so multiple tests. If Debug nlist Reset is NOT performed, the 2nd PR install will not see the 2nd Dev's pump. It will see the 1st PR's pump because nlist is still active! So install Dev (add pod) -> install PR (see Dev's Pod) -> Tap Debug nlist Reset -> install Dev (Add Pump is displayed, add a pump) -> install PR (see Dev's pump) |
Summary - Success
Configuration
Testing - Medtronic (continued)Test 2: build dev on top of fix
Test 3: transition from dev to fix
Testing - DASH, part 2Test 6 (for DASH): build dev over fix and then return to fix - revisited
OmniBLE Test for OmniBLE PR 125While running the DASH testing to first suspend and then resume above:
|
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.
I approve this as is. There is some question as to whether the debug option to delete (nlist or plist) should be left in. I have no strong opinion on this.
I tested for DASH and Medtronic and both worked as expected.
It seems like this PR is coming together now. Question: I had different experiences transitioning from dev to fix depending on having either the all previously installed, or more likely having other apps with the shared app group (xdrip4iOS and possibly other instances of Trio or iAPS). Will the fix work correctly also in these cases now? |
@bjornoleh I think your testing was before the most recent updates which fixed a problem. However, I did not test using more than one app on a phone (after the fix) so am doing that below: SummarySuccess. This app works as expected. If the debug: delete pump row is removed, the only consequence is for multiple round trips:
RecommendationIn my opinion, the debug: delete pump row should be removed. Other options are to comment out the code or label the row differently and shift it all the way down to the bottom of the menu. Testing configuration:
Test Details:
Status
TestingTest Trio
|
Test again with latest commit (comment out the debug: delete pump button). StatusSuccess ConfigurationThis continues directly from last comment I made in this PR.
Testing
|
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.
Tested before the final formatting change.
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.
This modification was requested because Xcode was auto-formatting the files to make the comments line up and that resulted in changes in the local clone with respect to GitHub.
Code review of final commit.
- This is only a change to the format for some comment lines.
- There is no need to retest functionality of the code.
- I built with Xcode and confirmed there are no modifications to files automtically made by Xcode
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.
Approving based on initial testing (partial success) and review of Marion's successful testing of the last changes after my tests with actual pods.
Verified that the app builds without uncommitted changes.
Ports over LoopKit/Loop#1702 to fix the loss of pumps and CGMs by no longer storing them as UserDefaults entry but via binary plist files. Storage of CGM info was already done via PR #15 back before Trio was opened for beta. This PR also migrates information storage for pump information.
Quoting from Loop PR:
Thank you to @kskandis and @avouspierre for the great collaboration.
Addresses and solves #231