Repository navigation
Remove Dexcom Share follower management - #96
Conversation
Followers can no longer be listed, invited or removed from the app. The legacy Share endpoints behind this can leave followers of the Dexcom app without updates. Followers set up through the Dexcom app are unaffected. Upload now posts readings first, and only signs in again, starts a monitoring session or registers the sensor as the account's device when the service refuses for that reason. This also stops uploads stalling after a sensor change until the app is relaunched.
ps2
left a comment
There was a problem hiding this comment.
Posting first and only recovering on the matching refusal looks good. It also fixes the sensor-change stall: G7CGMManager sets the new serial on the existing uploader, so the first MonitoredReceiverNotAssigned / SerialNumberDoesNotMatch registers the new sensor. The stubbed upload-flow tests are nice. All 176 G7SensorKit tests pass here (simulator, not tried against a real account).
A few things:
-
A refusal from a recovery isn't itself recovered. In
upload(_:serial:), ifperform(recovery)throws, the upload fails right away. Take a new sensor or a fresh account: the post is refused withMonitoringSessionNotActive, andStartRemoteMonitoringSessioncould then be refused because the receiver isn't assigned yet. The upload backs off 15 minutes and repeats the same sequence each time. It never callsReplacePublisherAccountMonitoredReceiver, so uploads stop for good. The old code always assigned first, so it couldn't hit this. The tests only cover the receiver-refused-first order. Could the error thrown byperformgo back throughrecovery(for:)too, keeping the once-per-recovery limit? -
assignedSerialis never cleared. If something else, e.g. the Dexcom app on another phone, takes the monitored receiver while the same sensor is in use, Loop won't register it again until relaunch or a sensor change. The settings screen shows an upload error meanwhile. If that's deliberate, so Loop doesn't fight the Dexcom app, a line in the description would help. If not, clearing it after a successful post would allow one re-registration per takeover. -
Followers already invited from Loop keep working, but they can only be seen or removed in the Dexcom app now. That's probably worth a note when this ships.
Minor: the removed follower strings are still in both Localizable.xcstrings files and will show as stale on the next export.
A monitoring session refused because the sensor is not registered yet failed the upload, so a new sensor or account never got registered and every retry repeated the same refusal. A recovery's own refusal now goes through the same recovery, and a new registration may start a new monitoring session. Keep a registered serial until relaunch or sign-in on purpose: if the Dexcom app takes the account's device back, let it.
|
Thanks Pete!
On the strings: the committed Tested against current next-dev: all 184 G7SensorKit tests pass. |
|
Thanks! |
Followers can no longer be listed, invited or removed from the app. The legacy Share endpoints behind this can leave followers of the Dexcom app without updates. Followers set up through the Dexcom app are unaffected.
Upload now posts readings first, and only signs in again, starts a monitoring session or registers the sensor as the account's device when the service refuses for that reason. This also stops uploads stalling after a sensor change until the app is relaunched.
Notes