Skip to content

Loop Settings not loading #1170

Closed
Closed

Description

@ps2

If Loop is launched in the background (via bluetooth, for example) before the first unlock of the phone, UserDefaults will be unavailable, due to it being stored with a file access protection of NSFileProtectionCompleteUntilFirstUserAuthentication.

This will then appear to the user as if settings have been deleted. Restarting Loop restores access to the settings, unless something triggers a write to settings before Loop is restarted.

Activity

  1. skimaniac commented on Nov 13, 2019

    @skimaniac

    I tried : ''This will then appear to the user as if settings have been deleted. Restarting Loop restores access to the settings.''

    -my override setting do not comme back.
    -still do not see basal on loop and no basal in apple Health

    IMG_0886
    IMG_0885
    IMG_8B2C4E784706-1

  2. skimaniac commented on Nov 13, 2019

    @skimaniac

    i also notice that when loop begin to communicate with the pump the basal appears (and the prediction line drop very low), and after few second the basal disappear again and the prediction line comme to a better view

    IMG_0888

    IMG_0889

  3. detroiterinnyc commented on Nov 15, 2019

    @detroiterinnyc

    I’m having this problem too. My full settings don’t restore. I’m guessing a rebuild is in my future.

  4. elnjensen commented on Nov 30, 2019

    @elnjensen
    Contributor

    Got hit by this tonight and can confirm that not all settings come back. Insulin model, carb ratios, sensitivities, and basal rates were correctly restored after restarting the app, but delivery limits, correction ranges, suspend threshold, and override presets were lost and had to be re-entered.

  5. ps2 commented on Nov 30, 2019

    @ps2
    CollaboratorAuthor

    Those will only be lost permanently if something is done to trigger a settings store before restarting Loop. Unfortunately, that’s pretty easy to do. Lots of actions, like enacting an override, can trigger that.

  6. loyalchallenger commented on Nov 30, 2019

    @loyalchallenger

    I tried to build the reset transmitter app. It did not work on my new iPhone 11 Pro. I had to restart my phone for that and Loop lost all my settings. They did not come back when I relaunched Loop and I had to rebuild Loop to get my settings back.

  7. elnjensen commented on Dec 7, 2019

    @elnjensen
    Contributor

    Despite trying to quickly quit and restart Loop when I encounter this, I’ve now lost my settings twice, simply from restarting my phone. Did not interact with the app at all when I saw the tell-tale open-Loop indicator on startup, but nonetheless settings didn’t come back after several app restarts.

  8. yeagerm commented on Dec 8, 2019

    @yeagerm

    Got hit by this tonight and can confirm that not all settings come back. Insulin model, carb ratios, sensitivities, and basal rates were correctly restored after restarting the app, but delivery limits, correction ranges, suspend threshold, and override presets were lost and had to be re-entered.

    I can confirm this problem. Three times now over the last two weeks or so. Latest LoopWorkspace/dev

  9. rolandet commented on Dec 8, 2019

    @rolandet

    @ps2 Any idea of how or when this will be fixed? My iPhone on 13.2.3 rebooted in the middle of the night and this obviously caused some issues for me without the config being loaded. This would appear to be a P1 issue.

  10. ps2 commented on Dec 9, 2019

    @ps2
    CollaboratorAuthor

    I have seen this happen a few times. Every time I've seen it happen, I've been able to get settings back by force-quitting Loop and starting it again. I'm not sure what is causing a settings save to be issued for those of you that are experiencing a more persistent loss of settings.

    I'm also having trouble getting this to reproduce in a way that allows me to work on it. Powering down, and waiting for a RL timer to kick off (once a minute), doesn't seem to do it. Letting the battery drain, plugging it in, and waiting for the RL timer also doesn't kick it off. Both of those failures point to Loop not actually starting until after unlock, which itself is a problem; Loop should be started after reboot, and before unlock, via RL timer.

    If anyone finds steps that reproduce this reliably, it would help with implementing a fix, or at least a workaround to reload settings from prefs when they become available.

  11. purplechap commented on Dec 9, 2019

    @purplechap

    Could that happen if users have the settings Software Update to Automatically Install Updates turned on? Maybe after an update the phone is in another status, that prevents settings from loading until the user has logged in again with their passcode.

  12. mtndev commented on Dec 9, 2019

    @mtndev
  13. rolandet commented on Dec 9, 2019

    @rolandet

    Since updating to iOS 13.2.3 from 12.4 last week I’ve seen this twice. I’m not sure how repeatable these are but I’ll document them.

    1. iPhone rebooted/crashed in the middle of the night and settings were not restored until I logged in the following morning.

    2. Reboot iPhone
      A. After reboot immediately logged in and started Loop. All settings were missing.
      B. Exited and killed Loop running in background.
      C. Restarted loop and some of the settings were restored as previously mentioned. For example, Insulin model, carb ratios, sensitivities, and basal rates were correctly restored after restarting the app, but delivery limits, correction ranges, suspend threshold, and override presets were lost and had to be re-entered.

  14. ps2 commented on Dec 10, 2019

    @ps2
    CollaboratorAuthor

    Can anyone who has experienced this issue note what hardware they were running? i.e. which iPhone/iPod model? Also, which iOS version.

  15. mtndev commented on Dec 10, 2019

    @mtndev

    It happens for us about 80% of the time.
    iPhone SE
    iOS 13.2 (kiddo is at school, so I can check if there's a 3rd number on the iOS release running)

  16. 2 remaining items

  17. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    @ps2 I can reliably reproduce using this:

    put phone in Low Battery mode
    shut down phone completely
    restart phone, but not unlock it
    wait about 10 min, unlock it but don't use an app (green light will still not be on in RL)
    wait another 5 min or so, open Loop app and settings will be gone.
    restarting Loop app will bring back the settings.

    I'm quite certain that I could probably eliminate some of the steps or streamline them (like maybe not have to wait 10 min? or 5 min?), but that's what I've done three times in a row that has worked to reproduce the issue and also give RL a chance to turn green light on if it were to want to. Also, I'm testing this with CGM set to Dexcom Share. I will retest tonight with an active transmitter instead to see if it would make a difference. Using Iphone Xs+ with ios 13.2.3

    I suspect this has a lot to do with Low Battery mode being on. That thing is a bugger.

  18. ps2 commented on Dec 11, 2019

    @ps2
    CollaboratorAuthor

    Thanks, those are the steps I've been trying in a variety of ways, but haven't tried with Low Battery mode being on. Will try that. Also, if you could capture a sysdiagnose from a session where it failed, that would be very helpful!

  19. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    Sure can do. I assume with bt profile going? @ps2

  20. ps2 commented on Dec 11, 2019

    @ps2
    CollaboratorAuthor

    Yes, bt debugging might be important to capture what's going on here.

  21. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    Watching a little closer...I do notice one interesting thing.

    I restarted phone at 9:55am, didn't unlock it until 9:59. The green light on RL was off from 9:55 to 9:59. After entering the passcode at 9:59 to unlock-after-restart...the green light did come back on briefly. Then was turned off again maybe 5-10-15 (?) seconds after it came on? So, looks like ios must be killing off the connection? I didn't open Loop app until after I saw the green light had been turned off again...wanted to see what was happening. Green light continues to be off.

  22. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    Sysdiagnose from that description above after I opened Loop app and saw settings were blank.

    https://www.dropbox.com/s/kql726pi0i6maq1/sysdiagnose_2019.12.11_10-00-35-0800_iPhone-OS_iPhone_17B111.tar.gz?dl=0

  23. ps2 commented on Dec 11, 2019

    @ps2
    CollaboratorAuthor

    And in that sysdiagnose settings were valid (not blank) before the phone was powered down, right?

  24. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    @ps2 yes, the settings were showing before powering down. I'd installed BT profile. Restarted phone. Opened Loop to see the settings were visible. Then powered down phone in Low power mode around 9:54am PST

  25. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    But just to triple check, I'll do it again and get another log. Can never be too sure lol

  26. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    So, this time I didn't see the green light turn on even briefly during the process (maybe my eyes played tricks on me the previous time?). Anyways...here's another log from a settings blank.

    Restarted phone at 10:28 with enter-code-to-unlock phone...didn't use any apps, just let it sit
    10:31 opened the phone again, opened Loop app...green light not on on RL, no settings in Loop.
    Started log. Definitely had confirmed the settings were in Loop before I'd started this test at 10:27am

    https://www.dropbox.com/s/8tgimw1azn9i2o2/sysdiagnose_2019.12.11_10-31-00-0800_iPhone-OS_iPhone_17B111.tar.gz?dl=0

  27. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    Also, every time I am testing this, my dexcom G5 app is quite unhappy. Perpetually stuck on this screen for G5 app now and makes a very annoying loud notification about it about a few minutes after the restart. Restarting the Dexcom app is not making it happy, unlike Loop's ability to recover.

    IMG_9168

  28. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    @ps2 also reproducible if Background App Refresh is turned off.

  29. Kdisimone commented on Dec 11, 2019

    @Kdisimone
    Collaborator

    Crowd sourcing further info on Looped group, there is a fellow who says he had settings disappear (1) not on a reboot (2) using master 1.9.6 and (3) iOS 13.2.3. So obviously more than just low power mode and background app refresh potentially going on. And not confined to dev.

  30. mtndev commented on Dec 11, 2019

    @mtndev

    Further info on the hardware question, we had to turn off the fingerprint unlock (iPhone SE) about a month ago (fingerprint started not working and then we couldn't dose). This issue has been since we unlock using code only. Not sure if that's related but in case it's helpful. This was happening on iOS 13.2.3 on dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions