Repository navigation
Carb Entry/Delete and Watch not in Sync with Phone #14
Description
EDITED March 12, 2022
Fix now in freeaps_dev, will close this issue with the next release of FreeAPS
This behavior was fixed by bringing over selected updates found in Loop-dev.
See Update watch code (from dev)
EDITED Dec 2, 2021
Partial solution for Issue 14 only
This fixed only one part of the problem - Carbs reported on watch immediately are not doubled until a loop cycle completes like they were before.
More work is needed. At least one report of carbs reappearing was posted on telegram chat.
I tested COB, IOB and suggested bolus on watch vs phone over time after a real meal and they did not agree.
The COB and IOB decay reported on watch lagged phone and the suggested bolus was greater on watch than phone.
Tapping on override triggered a sync so they matched again.
Please test - in your existing download, inside Xcode, navigate to this file:
LoopWorkspace/Loop/Loop/Managers/WatchDataManager.swift
For Loop Master (v2.2.6) and FreeAPS v2.2 (204) the line to be changed is 102.
- change is to add
, .carbsto the case.
(As of Dec 2, 2021, this modification is incorporated in the freeaps_dev branch)
code before modifcation
switch updateContext {
case .glucose, .tempBasal:
sendWatchContextIfNeeded()
case .preferences:
sendSettingsIfNeeded()
default:
break
}
code after modification
switch updateContext {
case .glucose, .tempBasal, .carbs:
sendWatchContextIfNeeded()
case .preferences:
sendSettingsIfNeeded()
default:
break
}
Rebuild and test.
History
I examined the diff for successive commits that affected this file.
The last time what is now line 102 was modified was on Sat Oct 6, 2018 by Pete Schwamb.
git diff 8e1df7c 34c390a -- Loop/Managers/WatchDataManager.swift
ORIGINAL Bug report below
Describe the bug
Carbs added by watch and deleted on phone can reappear
WARNING - if this happens to you and you do not notice, you could wind up with more insulin than you need.
See also Issue #15 Watch Bolus Screen does not follow Carb Entry
To Reproduce
Steps to reproduce the behavior:
- Add Carbs using the watch but do not bolus
- On phone, delete the carbs just added with watch
- Wait 5 minutes (1 loop cycle)
- Observe if the carbs come back
- Delete the carbs again - they will stay gone this time
Expected behavior
The carbs should remain deleted once they have been deleted.
In my case - I am running FreeAPS v2.2 (204) with an iPhone 12 running iOS 15.1 with a Series 7 41-mm watch running watchOS 8.1.
I have Open bolus screen after carbs on watch enabled.
I built a new version on my phone to test some things and noticed the bolus screen did not open after carb entry on watch.
It was only after this started happening that I did the test listed above. I was able to reproduce it.
For one test, I entered and deleted the carbs 3 times, then next loop cycle, all 3 copies of the carbs reappeared.
Activity
Nnk2 commentedon Nov 23, 2021
I can reproduce this on my setup too:
Carbs added by Watch, reappear after deleting on iPhone
Trpl7ca commentedon Nov 23, 2021
Also see it on Crowding v2.2 (205)
IOS 15.1.1
Watch 8.1.1
45mm series 7
Including no bolus screen after carb entry even though selected in settings
marionbarker commentedon Nov 23, 2021
I built from a fresh download of Loop v2.2.6
Note - For last test I looked at COB on watch.
Trpl7ca commentedon Nov 23, 2021
Not only did the carb entry on watch come back on the phone, but the bolus recommendation on watch did not change for the lower carb amount. So I just realized that if using the watch for carb and bolus entries you may give yourself more insulin than necessary because of the delay in sync. For example if you enter a carb amount and then bolus half the amount from the watch, using AB may add insulin also but the value does not show up on the watch until the next sync. So if you look at you watch recommendation before the sync you will not see the AB amount given, it will still show the remaining amount of initial insulin. You could be giving yourself more insulin that desired. There is no way to tell if the watch has synced unless you open the phone making the watch less useful IMO.
marionbarker commentedon Nov 26, 2021
Please do some tests to confirm that tapping on or off of any override always makes phone and watch in sync. As a work-around, you can force sync the phone and watch with this trick.
If anyone has suggestions for fixing this, please post it in this conversation.
Trpl7ca commentedon Nov 26, 2021
Yes that did work for me 3 times. A auto bolus was given that did not show on watch and by selecting pre-meal it would sync immediately.
bjornoleh commentedon Dec 2, 2021
I am
notseeing the respawned carbs (entered from watch and deleted on phone) with series 3, watchOS 7.6.2 and iOS 15.1, FreeAPS 2.2 204Edit, that was too quick, I am actually seeing this too!
Trpl7ca commentedon Dec 2, 2021
For me it took 10 min to reappear two loop cycles
bjornoleh commentedon Dec 2, 2021
After updating to watchOS 8.1 with the same setup as above, I am also getting the reappearing deleted carbs. But this issue is not only for watchOS 8. Possibly it is only with iOS 15.x, as I have not noticed it before updating from 15.8 to 15.1 today. But I am unsure about this.
[-]Carb Entry/Delete Problem[/-][+]Carb Entry/Delete and Watch not in Sync with Phone[/+]marionbarker commentedon May 11, 2023
Fix was merged in Jan 2023.