Repository navigation
Share outcomes with Loop developers from Current Setup - #2625
Merged
Merged
Conversation
Once the current setup has run for 2 weeks, the Current Setup screen links to a Share Outcomes screen. It lists what's sent and what isn't, prepares the package, shows its size and sends it to ingest.loopkit.org/v1/outcomes only when the person taps Send. Each share's receipt is kept so it can be deleted from the server later from the same screen. The package is a zip of per-day JSON files covering the last 6 weeks: settings, glucose, carbs, doses, dosing decisions and overrides, plus the settings and override in effect when the range starts, and a manifest with the app build, the last setup change and a random per-install ID. The device log and alerts are left out. Records are scrubbed at the JSON level: push token, device names and serial numbers, pump event bytes and descriptions, food descriptions and the dosing decisions' historicalGlucose are removed, and the updateRemoteRecommendation decisions are skipped. On a real 6-week export this takes the package from about 58 MB to about 15 MB. The delete token is made on the device and sent with the share, so a retry after a lost response gets back the receipt of the share already stored.
Any setup changes within the shared range are in the settings history, so they can be kept or left out in an analysis. The link no longer waits for the setup to run 2 weeks; its footer recommends that instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Current Setup screen links to a new Share Outcomes screen. Sharing is available at any time; the link's footer recommends about 2 weeks without setup changes as ideal, and any changes in the shared range are in the settings history. The screen:
ingest.loopkit.org/v1/outcomesonly when the person taps Send.Each share's receipt is kept on the device, so the share can be deleted from the server later from the same screen.
Package
The package is a zip of per-UTC-day JSON files covering the last 6 weeks: settings, glucose, carbs, doses, dosing decisions and overrides. It also holds:
The device log and alerts are left out.
Records are scrubbed at the JSON level:
historicalGlucose;updateRemoteRecommendationdecisions.On a real 6-week export, this takes the package from about 58 MB to about 15 MB.
Upload
The upload is streamed from a file, so the package is never held in memory whole. The delete token is made on the device and sent with the share, so a retry after a lost response gets back the receipt of the share already stored.
Server and viewer
The server side is deployed. Shares are visible only to members of the LoopKit developer team on GitHub, after they accept the developer terms of use.
Related
LoopKit/LoopKit#672 keeps critical event log exports valid JSON when a record fails to encode. This PR doesn't depend on it: records replaced by that placeholder are skipped here.
Testing
OutcomesPackageTests(scrubber and builder) pass.