Skip to content

Commit

Permalink
Merge branch 'master' into krystophv/dep-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophv committed Nov 10, 2017
2 parents 63583b0 + a5b5d77 commit 2bdc855
Show file tree
Hide file tree
Showing 38 changed files with 3,747 additions and 187 deletions.
10 changes: 9 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"stage-0",
"react"
],
"retainLines": true,
"plugins": ["add-module-exports"],
"env": {
"production": {
Expand All @@ -19,10 +20,17 @@
},
"test": {
"plugins": [
["resolver", { "resolveDirs": [ "app/node_modules" ]}],
[ "module-resolver", {
"root": ["./app/node_modules"],
"alias": {
"node-hid": "./app/node_modules/node-hid",
"serialport": "./app/node_modules/serialport"
}
} ],
["webpack-loaders", { "config": "webpack.config.test.js", "verbose": false }],
"babel-plugin-rewire",
["transform-define", {
"__VERSION_SHA__": "abcd",
"process.env.DEBUG_ERROR": false
}]
]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ coverage

_book/
web/

\.vscode/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Release management and application updates are handled via the Github provider i
1. When you're working on what might become a new release, increment the version number in `package.json` and `app/package.json` and commit/push (on the branch)
1. The CI server(s) will create a draft release in Github with the title of the version from the `package.json` file and will automatically attach the distribution artifacts to that draft (drafts are not publicly visible)
1. When your pull request is approved and merged to `master`, go to the draft release and type in the version for the tag name, ensure that you're targeting the `master` branch, fill out the release notes and publish the release. This will create the tag for you.
1. After you've smoke tested the release, run `yarn av-whitelist` to submit the release to Kaspersky Labs for whitelisting. The script generates an XML file and uploads it to their FTP. It requires a password that can be set using the `FTP_AV_PASSWORD_TIDEPOOL` environment variable and is stored in 1Password.

For a non-production release (alpha, dev, etc.)

Expand Down
11 changes: 10 additions & 1 deletion app/actions/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import _ from 'lodash';


import * as actionTypes from '../constants/actionTypes';
import * as actionSources from '../constants/actionSources';
import * as metrics from '../constants/metrics';
Expand Down Expand Up @@ -285,8 +284,18 @@ export function loginRequest() {
}

export function loginSuccess(results) {
const rollbar = require('../utils/rollbar');
const { user, profile, memberships } = results;
const isClinicAccount = personUtils.userHasRole(user, 'clinic');
// the rewire plugin messes with default export in tests
rollbar.configure && rollbar.configure({
payload: {
person: {
id: user.userid,
username: user.username,
}
}
});
return {
type: actionTypes.LOGIN_SUCCESS,
payload: { user, profile, memberships },
Expand Down
2 changes: 1 addition & 1 deletion app/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const serverdata = {
Local: {
API_URL: 'http://localhost:8009',
UPLOAD_URL: 'http://localhost:9122',
DATA_URL: 'http://localhost:8077',
DATA_URL: 'http://localhost:9220',
BLIP_URL: 'http://localhost:3000'
},
Development: {
Expand Down
1 change: 1 addition & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import rollbar from './utils/rollbar';
import _ from 'lodash';
import React from 'react';
import { render } from 'react-dom';
Expand Down
26 changes: 25 additions & 1 deletion app/main.development.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
/* global __ROLLBAR_POST_TOKEN__ */
import _ from 'lodash';
import { app, BrowserWindow, Menu, shell, ipcMain } from 'electron';
import { app, BrowserWindow, Menu, shell, ipcMain, crashReporter } from 'electron';
import os from 'os';
import open from 'open';
import { autoUpdater } from 'electron-updater';
import * as chromeFinder from 'chrome-launcher/chrome-finder';
import { sync as syncActions } from './actions';
import debugMode from '../app/utils/debugMode';
import Rollbar from 'rollbar/src/server/rollbar';

let rollbar;
if(process.env.NODE_ENV === 'production') {
rollbar = new Rollbar({
accessToken: __ROLLBAR_POST_TOKEN__,
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: 'electron_main_process'
}
});
}

crashReporter.start({
productName: 'Uploader',
companyName: 'Tidepool',
submitURL: '',
uploadToServer: false
});

console.log('Crash logs can be found in:',crashReporter.getCrashesDirectory());
console.log('Last crash report:', crashReporter.getLastCrashReport());

let menu;
let template;
Expand Down
8 changes: 8 additions & 0 deletions app/reducers/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ const devices = {
source: {type: 'device', driverId: 'AbbottFreeStyleLite'},
enabled: {mac: false, win: true}
},
abbottfreestylelibre: {
instructions: '(Unsupported) Plug in meter with micro-USB cable',
key: 'abbottfreestylelibre',
name: 'Abbott FreeStyle Libre (Beta)',
showDriverLink: {linux: false, mac: false, win: false},
source: {type: 'device', driverId: 'AbbottFreeStyleLibre'},
enabled: {linux: true, mac: true, win: true}
},
bayercontournext: {
instructions: 'Plug meter into USB port',
key: 'bayercontournext',
Expand Down
33 changes: 33 additions & 0 deletions app/utils/rollbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* global __VERSION_SHA__ */

import Rollbar from 'rollbar/dist/rollbar.umd';

let rollbar = new Rollbar({
accessToken: '1843589282464f4facd43f794c8201a8',
captureUncaught: true,
payload: {
environment: 'electron_renderer',
client: {
javascript: {
code_version: __VERSION_SHA__,
guess_uncaught_frames: true
}
}
},
// to deal with URI's as local filesystem paths, we use the "many domain" transform:
// https://rollbar.com/docs/source-maps/#using-source-maps-on-many-domains
transform: function(payload) {
var trace = payload.body.trace;
if (trace && trace.frames) {
for (var i = 0; i < trace.frames.length; i++) {
var filename = trace.frames[i].filename;
if (filename) {
trace.frames[i].filename = 'http://dynamichost/dist/bundle.js';
}
}
}
}
}
);

export default rollbar;
2 changes: 1 addition & 1 deletion config/device-debug.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export API_URL='http://localhost:8009'
export UPLOAD_URL='http://localhost:9122'
export DATA_URL='http://localhost:8077'
export DATA_URL='http://localhost:9220'
export BLIP_URL='http://localhost:3000'
export DEBUG_ERROR=true
export REDUX_LOG=false
Expand Down
2 changes: 1 addition & 1 deletion config/local.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export API_URL='http://localhost:8009'
export UPLOAD_URL='http://localhost:9122'
export DATA_URL='http://localhost:8077'
export DATA_URL='http://localhost:9220'
export BLIP_URL='http://localhost:3000'
export DEBUG_ERROR=false
export REDUX_LOG=false
Expand Down
2 changes: 1 addition & 1 deletion config/ui-debug.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export API_URL='http://localhost:8009'
export UPLOAD_URL='http://localhost:9122'
export DATA_URL='http://localhost:8077'
export DATA_URL='http://localhost:9220'
export BLIP_URL='http://localhost:3000'
export DEBUG_ERROR=false
export REDUX_LOG=true
Expand Down
5 changes: 3 additions & 2 deletions docs/checklists/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Checklists for the implementation of drivers for reading data from diabetes devices currently supported or in development.

* [Abbott FreeStyle (BGM)](abbottFreeStyleLite.md)
* [Abbott FreeStyle Lite & Freedom Lite (BGM)](abbottFreeStyleLite.md)
* [Abbott FreeStyle Libre (CGM & BGM data)](abbottFreeStyleLibre.md)
* [Abbott Precision Xtra (blood glucose & ketone meter)](abbottPrecisionXtra.md)
* [Animas Vibe (CGM data)](animasCGM.md)
* [Animas Ping and Vibe Insulin Pumps](animasPingAndVibe.md)
Expand All @@ -11,4 +12,4 @@ Checklists for the implementation of drivers for reading data from diabetes devi
* [Insulet OmniPod Insulin Delivery System](insuletOmniPod.md)
* [OneTouch VerioIQ (BGM)](oneTouchVerioIQ.md)
* [Tandem Insulin Pumps](tandem.md)
* [Tandem G4 (CGM data)](tandemCGM.md)
* [Tandem G4 (CGM data)](tandemCGM.md)
147 changes: 147 additions & 0 deletions docs/checklists/abbottFreeStyleLibre.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
## Checklist for CGM Implementation

(Key:

- `[x]` available in data protocol/documented in spec and implemented
- `[-]` available in data protocol/documented in spec but *not* yet implemented
- `[?]` unknown whether available in data protocol/documented in spec; *not* yet implemented
- `*[ ]` TODO: needs implementation!
- `[ ]` unavailable in data protocol and/or not documented in spec and not yet implemented)

### Required if Present

#### CBG

- `[x]` cbg values
- `[ ]` units of cbg values (read from device, not hard-coded)
- `[x]` out-of-range values (LO or HI)
- `[x]` out-of-range value thresholds (e.g., often 40 for low and 400 for high on CGMs)

Device-specific? (Add any device-specific notes/additions here.)
- internal glucose unit is always mg/dL for this device, independent of display unit
- out-of-range thresholds are 41 mg/dL and 499 mg/dL
- out-of-range measurements are reported as values 40 or 500 respectively

#### Device Events
- `[ ]` calibrations
- `[ ]` calibration value
- `[ ]` units of calibration value (read from device, not hard-coded)
- `[x]` time changes (presence of which is also in the [BtUTC section](#bootstrapping-to-utc) below)
- `[x]` device display time `from` (before change) and `to` (result of change)
- `[x]` agent of change (`automatic` or `manual`)
- `[ ]` timezone
- `[ ]` reason for change (read from device)

Device-specific? (Add any device-specific notes/additions here.)
- device does not need calibration

#### Settings

- `[x]` units preference for BG display
- `[x]` units of data being uploaded (will be mutated to mmol/L storage units if not mmol/L)
- `[x]` transmitter ID
- `[ ]` low alert settings
- `[ ]` enabled
- `[ ]` level/threshold
- `[ ]` snooze threshold
- `[ ]` high alert settings
- `[ ]` enabled
- `[ ]` level/threshold
- `[ ]` snooze threshold
- `[ ]` rate-of-change alerts
- `[ ]` fall rate alert
- `[ ]` enabled
- `[ ]` rate threshold for alerting
- `[ ]` rise rate alert
- `[ ]` enabled
- `[ ]` rate threshold for alerting
- `[ ]` out-of-range alerts
- `[ ]` enabled
- `[ ]` snooze time between alerts
- `[ ]` predictive alerts
- `[ ]` low prediction
- `[ ]` enabled
- `[ ]` time sensitivity (minutes to predicted low for alerting)
- `[ ]` high prediction
- `[ ]` enabled
- `[ ]` time sensitivity (minutes to predicted high for alerting)
- `[ ]` calibration alerts/reminders
- `[ ]` pre-reminder
- `[ ]` overdue alert

Settings history:

- `[ ]` device stores all changes to settings OR
- `[x]` device only returns current settings at time of upload

No Tidepool data model (yet): volume and/or vibrate mode of all alerts (can/should go in `payload`).

Device-specific? (Add any device-specific notes/additions here.)

#### "Bootstrapping" to UTC

- `[x]` index
- `[ ]` UTC timestamp (*Hey, one can dream!*) OR
- `[x]` internal timestamp or persistent log index (across device communication sessions) to order all pump events (regardless of type), independent of device display time OR
- `[ ]` ephemeral log index (does not persist across device communication sessions) to order all pump events (regardless of type), independent of device display time
- `[x]` date & time settings changes

Device-specific? (Add any device-specific notes/additions here.)

### No Tidepool Data Model Yet

> **NB:** You can and should add to this section if there are other data types documented in the device's data protocol specification but not part of Tidepool's data model (yet).
- `[-]` activity/exercise
- `[-]` food (e.g., Dexcom allows logging carb events)
- `[-]` notes/other events
- `[-]` insulin (rapid acting, long term)

### Tidepool ingestion API

Choose one of the following:

- `[x]` legacy "jellyfish" ingestion API
- `*[ ]` platform ingestion API

### Known implementation issues/TODOs

*Use this space to describe device-specific known issues or implementation TODOs **not** contained in the above datatype-specific sections.*


## Checklist for Blood Glucose Meter Implementation

### Required if Present

- `[x]` smbg values
- `[ ]` units of smbg values (read from device, not hard-coded)
- `[x]` out-of-range values (LO or HI)
- `[x]` out-of-range value thresholds (e.g., often 20 for low and 600 for high on BGMs)
- `[x]` date & time settings changes
- `[x]` blood ketone values
- `[ ]` units of blood ketone values (read from device, not hard-coded)
- `[x]` ketone out-of-range values
- `[x]` ketone out-of-range value thresholds

Device-specific? (Add any device-specific notes/additions here.)
- internal glucose unit is always mg/dL for this device, independent of display unit
- glucose out-of-range thresholds are 41 mg/dL and 499 mg/dL
- glucose out-of-range measurements are reported as values 40 or 500 respectively
- ketone out-of-range upper threshold is 8.0 mmol/L

### No Tidepool Data Model Yet

- `[x]` control (solution) tests (whether marked in UI or auto-detected) - until we have a data model, these should be discarded
- `[-]` device settings, other than date & time (e.g., target blood glucose range)
- `[-]` tag/note (e.g., pre- vs. post-meal)

### Tidepool ingestion API

Choose one of the following:

- `[x]` legacy "jellyfish" ingestion API
- `*[ ]` platform ingestion API

### Known implementation issues/TODOs

*Use this space to describe device-specific known issues or implementation TODOs **not** contained in the above datatype-specific sections.*
4 changes: 0 additions & 4 deletions docs/checklisttemplates/CGMChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,4 @@ Choose one of the following:

### Known implementation issues/TODOs

Add any device-specific known issues or implementation TODOs here in checklist format.

### Known implementation issues/TODOs

*Use this space to describe device-specific known issues or implementation TODOs **not** contained in the above datatype-specific sections.*
Loading

0 comments on commit 2bdc855

Please sign in to comment.