From 95cc10124d445feef19d20766ddc8ac06bcebbc1 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 6 Feb 2024 16:16:29 +0000 Subject: [PATCH 01/25] allow for uploading of Accu-chek Instant and ReliOn Platinum --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 10 ++++++++-- yarn.lock | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index cf0e4be16..3cc6d06f5 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -87,7 +87,8 @@ module.exports = (config) => { if (!cfg.deviceInfo.name.startsWith('CareSens') && !cfg.deviceInfo.name.startsWith('ReliOn 2395') && !cfg.deviceInfo.name.startsWith('ReliOn 0015') && - !cfg.deviceInfo.name.startsWith('TNG VOICE')) { + !cfg.deviceInfo.name.startsWith('TNG VOICE') && + !cfg.deviceInfo.name.startsWith('meter+')) { return cb (new Error('We don\'t currently support this meter.')); } @@ -106,7 +107,12 @@ module.exports = (config) => { cfg.deviceTags = ['bgm']; cfg.deviceInfo.deviceId = `${[cfg.deviceInfo.manufacturers]}-${cfg.deviceInfo.model}`; - if(env.electron){ + + if(cfg.deviceInfo.name.startsWith('meter+')) { + cfg.deviceInfo.serial = cfg.deviceInfo.model + cfg.deviceInfo.name.slice(6); + cfg.deviceInfo.deviceId = `-${cfg.deviceInfo.name.slice(6)}`; + data.deviceModel = cfg.deviceInfo.model; + } else if(env.electron){ cfg.deviceInfo.deviceId += `-${remote.getGlobal('bluetoothDeviceId')}`; } else { cfg.deviceInfo.deviceId += `-${cfg.deviceComms.ble.device.id}`; diff --git a/yarn.lock b/yarn.lock index 82a9d49fc..739ac978d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4876,9 +4876,14 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001400: - version "1.0.30001434" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz#ec1ec1cfb0a93a34a0600d37903853030520a4e5" - integrity sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA== + version "1.0.30001584" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz" + integrity sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ== + +caniuse-lite@^1.0.30001584: + version "1.0.30001584" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz#5e3ea0625d048d5467670051687655b1f7bf7dfd" + integrity sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ== capture-exit@^2.0.0: version "2.0.0" From fddb858eaeab985d359b4c2da3be80057a940fd7 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 30 Jul 2024 14:15:17 +0100 Subject: [PATCH 02/25] add Bluetooth support for ReliOn Platinum --- app/components/Upload.js | 2 +- app/reducers/devices.js | 12 +++++++++++- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 11 ++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/components/Upload.js b/app/components/Upload.js index 6cc0c1c0e..3c43cac43 100644 --- a/app/components/Upload.js +++ b/app/components/Upload.js @@ -212,7 +212,7 @@ export default class Upload extends Component { return this.handleMedtronic600Upload(); } - if (device === 'caresensble' || device === 'onetouchverioble' || device === 'foracareble') { + if (device === 'caresensble' || device === 'onetouchverioble' || device === 'foracareble' || device === 'relionplatinumble') { return this.handleBluetoothUpload(_.get(upload, 'key', null)); } diff --git a/app/reducers/devices.js b/app/reducers/devices.js index 1ed20d997..e491b8fcc 100644 --- a/app/reducers/devices.js +++ b/app/reducers/devices.js @@ -243,6 +243,17 @@ const devices = { enabled: {mac: true, win: true, linux: true}, powerOnlyWarning: true, // shows warning for power-only USB cables }, + relionplatinumble: { + instructions: { + text: i18n.t('To pair: With meter off, hold the down arrow button until Bluetooth symbol appears \u2022 For full pairing instructions,'), + linkText: i18n.t('visit our support site'), + link: 'https://support.tidepool.org/hc/en-us/articles/360035332972#h_01EDCWR70ZH3WMHY4RX3SC80NX', // FIXME + }, + name: 'ReliOn Platinum (using Bluetooth)', + key: 'relionplatinumble', + source: {type: 'device', driverId: 'BluetoothLE'}, + enabled: {mac: true, win: true, linux: true} + }, relionpremier: { instructions: i18n.t('Plug in meter with cable and make sure the meter is switched on'), name: 'ReliOn Premier (BLU, Voice & Classic)', @@ -298,4 +309,3 @@ if (env.electron) { } export default devices; - diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index cf0e4be16..bde520849 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -87,7 +87,8 @@ module.exports = (config) => { if (!cfg.deviceInfo.name.startsWith('CareSens') && !cfg.deviceInfo.name.startsWith('ReliOn 2395') && !cfg.deviceInfo.name.startsWith('ReliOn 0015') && - !cfg.deviceInfo.name.startsWith('TNG VOICE')) { + !cfg.deviceInfo.name.startsWith('TNG VOICE') && + !cfg.deviceInfo.name.startsWith('meter+')) { return cb (new Error('We don\'t currently support this meter.')); } @@ -110,16 +111,16 @@ module.exports = (config) => { cfg.deviceInfo.deviceId += `-${remote.getGlobal('bluetoothDeviceId')}`; } else { cfg.deviceInfo.deviceId += `-${cfg.deviceComms.ble.device.id}`; - } + } cfg.builder.setDefaults({ deviceId: cfg.deviceInfo.deviceId }); - if (cfg.deviceInfo.name.startsWith('CareSens') || + if (cfg.deviceInfo.name.startsWith('CareSens') || cfg.deviceInfo.name.startsWith('ReliOn 2395') || cfg.deviceInfo.name.startsWith('ReliOn 0015')) { let abortTimer = null; - + (async () => { try { cfg.deviceComms.ble.customService = await cfg.deviceComms.ble.server.getPrimaryService(0xFFF0); @@ -154,7 +155,7 @@ module.exports = (config) => { sundial.formatInTimezone(serverTime, cfg.timezone, 'm'), sundial.formatInTimezone(serverTime, cfg.timezone, 's') ); - + try { // we don't wait for a confirmation, as it takes too long for the // meter to reply with the updated time From d6d47f081943598cb72db3358a3922bb1432b317 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 1 Aug 2024 15:53:05 +0100 Subject: [PATCH 03/25] fix link --- app/reducers/devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/reducers/devices.js b/app/reducers/devices.js index e491b8fcc..3ff2e8a3e 100644 --- a/app/reducers/devices.js +++ b/app/reducers/devices.js @@ -247,7 +247,7 @@ const devices = { instructions: { text: i18n.t('To pair: With meter off, hold the down arrow button until Bluetooth symbol appears \u2022 For full pairing instructions,'), linkText: i18n.t('visit our support site'), - link: 'https://support.tidepool.org/hc/en-us/articles/360035332972#h_01EDCWR70ZH3WMHY4RX3SC80NX', // FIXME + link: 'https://support.tidepool.org/hc/en-us/articles/14204858905492-Uploading-your-ReliOn-Platinum-meter', }, name: 'ReliOn Platinum (using Bluetooth)', key: 'relionplatinumble', From 4ea754ccdf9844360e0f2cc44246a3126eabbe27 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 1 Aug 2024 16:42:36 +0100 Subject: [PATCH 04/25] v2.58.0-platinum-ble.1 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 00424f4fb..823f3c601 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "tidepool-uploader", "productName": "tidepool-uploader", - "version": "2.58.0-react-oidc-context.4", + "version": "2.58.0-platinum-ble.1", "description": "Tidepool Project Universal Uploader", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index 2865ae1b2..563d84ba9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidepool-uploader", - "version": "2.58.0-react-oidc-context.4", + "version": "2.58.0-platinum-ble.1", "description": "Tidepool Project Universal Uploader", "private": true, "main": "main.prod.js", From 1ac5f871096ced7b8c3e4203c6c4bd984a415518 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 24 Sep 2024 11:20:48 +0100 Subject: [PATCH 05/25] fix deviceId --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index 117f643a9..389c4fe66 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -110,7 +110,7 @@ module.exports = (config) => { if(cfg.deviceInfo.name.startsWith('meter+')) { cfg.deviceInfo.serial = cfg.deviceInfo.model + cfg.deviceInfo.name.slice(6); - cfg.deviceInfo.deviceId = `-${cfg.deviceInfo.name.slice(6)}`; + cfg.deviceInfo.deviceId += `-${cfg.deviceInfo.name.slice(6)}`; data.deviceModel = cfg.deviceInfo.model; } else if(env.electron){ cfg.deviceInfo.deviceId += `-${remote.getGlobal('bluetoothDeviceId')}`; From 915deb3878f7abdff1c03b9ec58426723a42678e Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 24 Sep 2024 13:08:37 +0100 Subject: [PATCH 06/25] fix threshold; ignore unlisted Accu-chek values --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index 389c4fe66..b5f5e6c77 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -289,20 +289,19 @@ module.exports = (config) => { record.value = 601; annotation = { code: 'bg/out-of-range', - threshold: 600, value: 'high', }; - } else if (record.value < 20) { - record.value = 19; + } else if (record.value < 10) { + record.value = 9; // set value below lowest known threshold annotation = { code: 'bg/out-of-range', - threshold: 20, value: 'low', }; } } - if (record.type !== 10) { //check that it's not control solution + if (record.type !== 10 && // check that it's not control solution + record.type !== 4) { // Accu-Chek meters record unlisted values with type 4 let postRecord = null; if (isKetone) { @@ -321,6 +320,12 @@ module.exports = (config) => { if (annotation) { annotate.annotateEvent(postRecord, annotation); + // BG treshold values are not provided, and we know there are meters + // with different thresholds, e.g. Accu-chek Instant range is 10-600mg/dL + // vs 20-600mg/dL for other meters, so we annotate that threshold is unknown + annotate.annotateEvent(postRecord, { + code: 'bg/unknown-value', + }); } cfg.tzoUtil.fillInUTCInfo(postRecord, record.timestamp); From ca38f5e1550f3b2181cc609aa82afa9f5f5a4e93 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Mon, 30 Sep 2024 14:33:03 +0100 Subject: [PATCH 07/25] match deviceId between USB and BLE --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 8 ++++---- locales/en/translation.missing.json | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index d7fd74d5b..e5fa4213d 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -112,7 +112,7 @@ module.exports = (config) => { if(cfg.deviceInfo.name.startsWith('meter+')) { cfg.deviceInfo.serial = cfg.deviceInfo.model + cfg.deviceInfo.name.slice(6); - cfg.deviceInfo.deviceId += `-${cfg.deviceInfo.name.slice(6)}`; + cfg.deviceInfo.deviceId += `-${cfg.deviceInfo.serial}`; data.deviceModel = cfg.deviceInfo.model; } else if(env.electron){ cfg.deviceInfo.deviceId += `-${remote.getGlobal('bluetoothDeviceId')}`; @@ -207,7 +207,7 @@ module.exports = (config) => { fetchData(progress, data, cb) { debug('in fetchData', data); let retryTimer = null; - + api.getMostRecentUploadRecord(cfg.groupId, cfg.deviceInfo.deviceId, function(err, lastUpload) { if (err) { return cb(err); @@ -218,7 +218,7 @@ module.exports = (config) => { if (data.lastEndPosition) { debug('Last record read was', data.lastEndPosition, ', starting from there'); } - + const abortTimer = setTimeout(() => { debug('TIMEOUT'); return cb('Timeout error. Did the meter pair succesfully?', null); @@ -254,7 +254,7 @@ module.exports = (config) => { }, 1000); try { - + if (data.lastEndPosition && uploadDataPeriod.periodGlobal === uploadDataPeriod.PERIODS.DELTA) { debug('Getting number of new records..'); await cfg.deviceComms.ble.getDeltaNumberOfRecords(data.lastEndPosition + 1); diff --git a/locales/en/translation.missing.json b/locales/en/translation.missing.json index 9c0597540..a0369d75b 100644 --- a/locales/en/translation.missing.json +++ b/locales/en/translation.missing.json @@ -67,5 +67,7 @@ "but we recommend updating as soon as possible.": "but we recommend updating as soon as possible.", "Unlock PDM. Plug into USB. Tap Export on PDM. Click Upload.": "Unlock PDM. Plug into USB. Tap Export on PDM. Click Upload.", "Plug in PDA with micro-USB": "Plug in PDA with micro-USB", - "Share this issue with the Tidepool Support Team": "Share this issue with the Tidepool Support Team" + "Share this issue with the Tidepool Support Team": "Share this issue with the Tidepool Support Team", + "To pair: With meter off, hold the down arrow button until Bluetooth symbol appears • For full pairing instructions,": "To pair: With meter off, hold the down arrow button until Bluetooth symbol appears • For full pairing instructions,", + "We couldn't log you in. Try again in a few minutes.": "We couldn't log you in. Try again in a few minutes." } \ No newline at end of file From 9fa3dbee822f64edd65d81e3e7997a2044d92f5a Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 3 Oct 2024 13:29:09 +0100 Subject: [PATCH 08/25] move Accu-chek into alphabetical order --- app/reducers/devices.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/reducers/devices.js b/app/reducers/devices.js index bafbfa022..4e92e7caf 100644 --- a/app/reducers/devices.js +++ b/app/reducers/devices.js @@ -41,6 +41,14 @@ const devices = { source: {type: 'device', driverId: 'AbbottPrecisionXtra'}, enabled: {mac: false, win: true, linux: true} }, + accuchekusb: { + instructions: i18n.t('Plug in meter with micro-USB cable'), + name: 'Accu-Chek Aviva Connect, Instant, Guide & Guide Me', + key: 'accuchekusb', + source: {type: 'device', driverId: 'AccuChekUSB'}, + enabled: {mac: true, win: true, linux: true}, + powerOnlyWarning: true, // shows warning for power-only USB cables + }, bayercontournext: { instructions: i18n.t('Plug meter into USB port'), key: 'bayercontournext', @@ -279,14 +287,6 @@ const devices = { source: {type: 'device', driverId: 'ReliOnPrime'}, enabled: {mac: true, win: true, linux: true}, }, - accuchekusb: { - instructions: i18n.t('Plug in meter with micro-USB cable'), - name: 'Accu-Chek Aviva Connect, Instant, Guide & Guide Me', - key: 'accuchekusb', - source: {type: 'device', driverId: 'AccuChekUSB'}, - enabled: {mac: true, win: true, linux: true}, - powerOnlyWarning: true, // shows warning for power-only USB cables - }, tandem: { instructions: i18n.t('Plug in pump with micro-USB'), key: 'tandem', From 07def2059932a06a177f5f82dd6eb01c585db186 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 3 Oct 2024 16:26:51 +0100 Subject: [PATCH 09/25] strip seconds from Bluetooth uploads of Roche meters to prevent duplication with USB uploads --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 7 +++++++ locales/en/translation.missing.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index f24dc6307..f65046ea2 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -339,6 +339,13 @@ module.exports = (config) => { .with_units(record.units); } + if (cfg.deviceInfo.manufacturers.includes('Roche')) { + // The roche/accuChekUSB.js driver does not record seconds, so to prevent + // duplicates we also remove seconds from the Bluetooth uploads for Roche + // meters (even the one branded as ReliOn Platinum) + record.timestamp.setSeconds(0); + } + postRecord .with_deviceTime(sundial.formatDeviceTime(record.timestamp)) .set('index', record.seqNum); diff --git a/locales/en/translation.missing.json b/locales/en/translation.missing.json index 97c596b79..66000bb96 100644 --- a/locales/en/translation.missing.json +++ b/locales/en/translation.missing.json @@ -73,4 +73,4 @@ "Data is up to date": "Data is up to date", "There is no data on the device. If you think this is an error, please reach out below.": "There is no data on the device. If you think this is an error, please reach out below.", "Unlock PDM. Plug into USB. Tap Export on PDM. Click Upload.": "Unlock PDM. Plug into USB. Tap Export on PDM. Click Upload." -} +} \ No newline at end of file From 0cf2a11f7961c3d5f0e09d46b02f94b1a91d631b Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 3 Oct 2024 16:28:33 +0100 Subject: [PATCH 10/25] v2.59.1-platinum-ble.2 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index da5d190ca..27eb028aa 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "tidepool-uploader", "productName": "tidepool-uploader", - "version": "2.59.1-platinum-ble.1", + "version": "2.59.1-platinum-ble.2", "description": "Tidepool Project Universal Uploader", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index b90f2df3d..604648c33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidepool-uploader", - "version": "2.59.1-platinum-ble.1", + "version": "2.59.1-platinum-ble.2", "description": "Tidepool Project Universal Uploader", "private": true, "main": "main.prod.js", From 2d8cdcde9baa483e766bc95e43d33e283ddcd43a Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 10:55:13 +0100 Subject: [PATCH 11/25] show device model in metrics if available when upload failed --- app/actions/sync.js | 1 + lib/drivers/tandem | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/actions/sync.js b/app/actions/sync.js index e3865e96d..7e126ea2e 100644 --- a/app/actions/sync.js +++ b/app/actions/sync.js @@ -441,6 +441,7 @@ export function uploadFailure(err, errProps, device) { const properties = { type: _.get(device, 'source.type', undefined), source: `${actionUtils.getUploadTrackingId(device)}`, + deviceModel: _.get(data, 'deviceModel', undefined), os: `${actionUtils.getOSDetails()}`, error: err }; diff --git a/lib/drivers/tandem b/lib/drivers/tandem index 2b598f844..a5b753895 160000 --- a/lib/drivers/tandem +++ b/lib/drivers/tandem @@ -1 +1 @@ -Subproject commit 2b598f8446d7bd883c40f120b6cc354d964cda0b +Subproject commit a5b753895d7f16a3c952c6c08c953c828af37cb9 From 691111697a03319917cc204b3d458f326233ae98 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 10:56:09 +0100 Subject: [PATCH 12/25] v2.59.1-platinum-ble.3 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 27eb028aa..72036ddcd 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "tidepool-uploader", "productName": "tidepool-uploader", - "version": "2.59.1-platinum-ble.2", + "version": "2.59.1-platinum-ble.3", "description": "Tidepool Project Universal Uploader", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index 604648c33..55d6d12fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidepool-uploader", - "version": "2.59.1-platinum-ble.2", + "version": "2.59.1-platinum-ble.3", "description": "Tidepool Project Universal Uploader", "private": true, "main": "main.prod.js", From 5c98897fa3cdc38a55b40e0ab73072138f943d83 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 11:17:19 +0100 Subject: [PATCH 13/25] use device key as deviceModel is not available --- app/actions/sync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/actions/sync.js b/app/actions/sync.js index 7e126ea2e..7c6eb31f8 100644 --- a/app/actions/sync.js +++ b/app/actions/sync.js @@ -441,7 +441,7 @@ export function uploadFailure(err, errProps, device) { const properties = { type: _.get(device, 'source.type', undefined), source: `${actionUtils.getUploadTrackingId(device)}`, - deviceModel: _.get(data, 'deviceModel', undefined), + device: device.key, os: `${actionUtils.getOSDetails()}`, error: err }; From 9a57efce3ba059fc9a52855987846210635498ee Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 12:01:06 +0100 Subject: [PATCH 14/25] fix tests --- test/app/actions/async.test.js | 9 ++++++--- test/app/actions/sync.test.js | 6 ++++-- test/app/actions/utils.test.js | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/app/actions/async.test.js b/test/app/actions/async.test.js index b2a8b9f55..798be0e6d 100644 --- a/test/app/actions/async.test.js +++ b/test/app/actions/async.test.js @@ -1735,7 +1735,8 @@ describe('Asynchronous Actions', () => { type: targetDevice.source.type, source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', - error: err + error: err, + device: undefined, } } } @@ -1844,7 +1845,8 @@ describe('Asynchronous Actions', () => { type: targetDevice.source.type, source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', - error: err + error: err, + device: undefined, } } } @@ -1957,7 +1959,8 @@ describe('Asynchronous Actions', () => { type: targetDevice.source.type, source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', - error: err + error: err, + device: undefined, } } } diff --git a/test/app/actions/sync.test.js b/test/app/actions/sync.test.js index 4df443921..5156e54a1 100644 --- a/test/app/actions/sync.test.js +++ b/test/app/actions/sync.test.js @@ -828,7 +828,8 @@ describe('Synchronous Actions', () => { type: device.source.type, source: device.source.driverId, os: 'BeOS R5.1 (RISC-V)', - error: resError + error: resError, + device: undefined, } } } @@ -859,7 +860,8 @@ describe('Synchronous Actions', () => { source: device.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: resError, - limit: '4 weeks' + limit: '4 weeks', + device: undefined, } } } diff --git a/test/app/actions/utils.test.js b/test/app/actions/utils.test.js index 506760147..200152846 100644 --- a/test/app/actions/utils.test.js +++ b/test/app/actions/utils.test.js @@ -84,6 +84,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, + device: undefined, } } } @@ -130,6 +131,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, + device: undefined, } } } From a502bd496221b2c0df2900f422d91258355a61e0 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 13:39:38 +0100 Subject: [PATCH 15/25] use deviceDriver as device is already taken --- app/actions/sync.js | 2 +- test/app/actions/async.test.js | 6 +++--- test/app/actions/sync.test.js | 4 ++-- test/app/actions/utils.test.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/actions/sync.js b/app/actions/sync.js index 7c6eb31f8..07a6d1ab1 100644 --- a/app/actions/sync.js +++ b/app/actions/sync.js @@ -441,7 +441,7 @@ export function uploadFailure(err, errProps, device) { const properties = { type: _.get(device, 'source.type', undefined), source: `${actionUtils.getUploadTrackingId(device)}`, - device: device.key, + deviceDriver: device.key, os: `${actionUtils.getOSDetails()}`, error: err }; diff --git a/test/app/actions/async.test.js b/test/app/actions/async.test.js index 798be0e6d..9d57808cd 100644 --- a/test/app/actions/async.test.js +++ b/test/app/actions/async.test.js @@ -1736,7 +1736,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - device: undefined, + deviceDriver: undefined, } } } @@ -1846,7 +1846,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - device: undefined, + deviceDriver: undefined, } } } @@ -1960,7 +1960,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - device: undefined, + deviceDriver: undefined, } } } diff --git a/test/app/actions/sync.test.js b/test/app/actions/sync.test.js index 5156e54a1..857cca13e 100644 --- a/test/app/actions/sync.test.js +++ b/test/app/actions/sync.test.js @@ -829,7 +829,7 @@ describe('Synchronous Actions', () => { source: device.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: resError, - device: undefined, + deviceDriver: undefined, } } } @@ -861,7 +861,7 @@ describe('Synchronous Actions', () => { os: 'BeOS R5.1 (RISC-V)', error: resError, limit: '4 weeks', - device: undefined, + deviceDriver: undefined, } } } diff --git a/test/app/actions/utils.test.js b/test/app/actions/utils.test.js index 200152846..adb54e253 100644 --- a/test/app/actions/utils.test.js +++ b/test/app/actions/utils.test.js @@ -84,7 +84,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, - device: undefined, + deviceDriver: undefined, } } } @@ -131,7 +131,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, - device: undefined, + deviceDriver: undefined, } } } From c53f5db4ea4feb55a27b233ac4c79c50cc37744c Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 14:24:08 +0100 Subject: [PATCH 16/25] actually, using device is fine - I just needed to fix the tests properly --- app/actions/sync.js | 2 +- test/app/actions/async.test.js | 6 +++--- test/app/actions/sync.test.js | 4 ++-- test/app/actions/utils.test.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/actions/sync.js b/app/actions/sync.js index 07a6d1ab1..7c6eb31f8 100644 --- a/app/actions/sync.js +++ b/app/actions/sync.js @@ -441,7 +441,7 @@ export function uploadFailure(err, errProps, device) { const properties = { type: _.get(device, 'source.type', undefined), source: `${actionUtils.getUploadTrackingId(device)}`, - deviceDriver: device.key, + device: device.key, os: `${actionUtils.getOSDetails()}`, error: err }; diff --git a/test/app/actions/async.test.js b/test/app/actions/async.test.js index 9d57808cd..b6975bebe 100644 --- a/test/app/actions/async.test.js +++ b/test/app/actions/async.test.js @@ -1736,7 +1736,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - deviceDriver: undefined, + device: 'a_pump', } } } @@ -1846,7 +1846,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - deviceDriver: undefined, + device: 'a_pump', } } } @@ -1960,7 +1960,7 @@ describe('Asynchronous Actions', () => { source: targetDevice.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: err, - deviceDriver: undefined, + device: 'a_pump', } } } diff --git a/test/app/actions/sync.test.js b/test/app/actions/sync.test.js index 857cca13e..5156e54a1 100644 --- a/test/app/actions/sync.test.js +++ b/test/app/actions/sync.test.js @@ -829,7 +829,7 @@ describe('Synchronous Actions', () => { source: device.source.driverId, os: 'BeOS R5.1 (RISC-V)', error: resError, - deviceDriver: undefined, + device: undefined, } } } @@ -861,7 +861,7 @@ describe('Synchronous Actions', () => { os: 'BeOS R5.1 (RISC-V)', error: resError, limit: '4 weeks', - deviceDriver: undefined, + device: undefined, } } } diff --git a/test/app/actions/utils.test.js b/test/app/actions/utils.test.js index adb54e253..200152846 100644 --- a/test/app/actions/utils.test.js +++ b/test/app/actions/utils.test.js @@ -84,7 +84,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, - deviceDriver: undefined, + device: undefined, } } } @@ -131,7 +131,7 @@ describe('utils', () => { source: 'bar', os: 'BeOS R5.1 (RISC-V)', error: displayErr, - deviceDriver: undefined, + device: undefined, } } } From 61ffe05efd2231a2a4a1d105245e684810cb91cc Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 14:38:50 +0100 Subject: [PATCH 17/25] remove a line to see what circleci does --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ef0c6bcc..c4e8e2722 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,6 @@ jobs: nvm alias default v18.17.1 - run: node -v - run: npm install --global npm node-gyp - - run: npm -v - run: node-gyp -v - run: curl -o- -L https://yarnpkg.com/install.sh | bash - run: yarn config set cache-folder ~/.cache/yarn From 7639a7af369c05ca64286d0219f3054a8f69e9eb Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 14:43:23 +0100 Subject: [PATCH 18/25] let's try deleting the prefix --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4e8e2722..34c7db546 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,9 @@ jobs: nvm install v18.17.1 nvm alias default v18.17.1 - run: node -v + - run: npm config delete prefix - run: npm install --global npm node-gyp + - run: npm -v - run: node-gyp -v - run: curl -o- -L https://yarnpkg.com/install.sh | bash - run: yarn config set cache-folder ~/.cache/yarn From 783367d02b3de44b4746a05681c8959624d1b5c9 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 15:04:34 +0100 Subject: [PATCH 19/25] remove more stuff to see what circleci does --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34c7db546..9312e68c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,10 +28,7 @@ jobs: nvm install v18.17.1 nvm alias default v18.17.1 - run: node -v - - run: npm config delete prefix - run: npm install --global npm node-gyp - - run: npm -v - - run: node-gyp -v - run: curl -o- -L https://yarnpkg.com/install.sh | bash - run: yarn config set cache-folder ~/.cache/yarn - run: yarn --frozen-lockfile From d045cc3bfdfb21c7575854acf67a6f5810227c58 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 15:18:00 +0100 Subject: [PATCH 20/25] still trying to figure out macos build on circleci --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9312e68c0..e24ceb185 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,10 @@ jobs: nvm install v18.17.1 nvm alias default v18.17.1 - run: node -v + - run: nvm use --delete-prefix v18.17.1 --silent - run: npm install --global npm node-gyp + - run: npm -v + - run: node-gyp -v - run: curl -o- -L https://yarnpkg.com/install.sh | bash - run: yarn config set cache-folder ~/.cache/yarn - run: yarn --frozen-lockfile From a814c579028863a6920b885fd82c1fec8ea0da19 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 15:22:23 +0100 Subject: [PATCH 21/25] try renaming devEngines to engines instead --- .circleci/config.yml | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e24ceb185..5ef0c6bcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,6 @@ jobs: nvm install v18.17.1 nvm alias default v18.17.1 - run: node -v - - run: nvm use --delete-prefix v18.17.1 --silent - run: npm install --global npm node-gyp - run: npm -v - run: node-gyp -v diff --git a/package.json b/package.json index 55d6d12fd..439ff7f11 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,7 @@ "xmlbuilder": "15.1.1", "yup": "0.32.9" }, - "devEngines": { + "engines": { "node": ">=7.9.x", "npm": ">=3.x" }, From b1fdc72d2402d446e3e657d63d310e3a1ecbbab0 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 15:46:00 +0100 Subject: [PATCH 22/25] bump version of nvm --- .circleci/config.yml | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ef0c6bcc..2f58bee33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,12 +23,16 @@ jobs: name: Install nvm and node command: | set +e - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash source ~/.nvm/nvm.sh + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" nvm install v18.17.1 nvm alias default v18.17.1 - run: node -v - run: npm install --global npm node-gyp + - run: echo $SHELL - run: npm -v - run: node-gyp -v - run: curl -o- -L https://yarnpkg.com/install.sh | bash diff --git a/package.json b/package.json index 439ff7f11..55d6d12fd 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,7 @@ "xmlbuilder": "15.1.1", "yup": "0.32.9" }, - "engines": { + "devEngines": { "node": ">=7.9.x", "npm": ">=3.x" }, From a3c3594ca69bbe0fb2048a72498c416fc95fe830 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Thu, 10 Oct 2024 16:21:34 +0100 Subject: [PATCH 23/25] change from npm to yarn in package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55d6d12fd..04d61f2b4 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "start-main-dev": "cross-env HOT=1 NODE_ENV=development electron --no-sandbox -r @babel/register ./app/main.dev.js", "server": "node server", "prepare-qa-build": "node -r @babel/register scripts/prepare-qa-build.js", - "package": "npm run build-quiet && electron-builder -p always -c electron-builder-publish.js" + "package": "yarn build-quiet && electron-builder -p always -c electron-builder-publish.js" }, "dependencies": { "@electron/remote": "2.1.2", From 6e4da57c7fa6e5459ac28db8ddeeff5055de10f2 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 15 Oct 2024 10:17:44 +0100 Subject: [PATCH 24/25] convert Roche model numbers into model names for Bluetooth driver --- lib/drivers/bluetoothLE/bluetoothLEDriver.js | 9 ++++- lib/drivers/roche/accuChekUSB.js | 23 +---------- lib/drivers/roche/models.js | 41 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 lib/drivers/roche/models.js diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index f65046ea2..76f940517 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -25,6 +25,7 @@ import structJs from '../../struct'; import common from '../../commonFunctions'; import uploadDataPeriod from '../../../app/utils/uploadDataPeriod'; import api from '../../core/api'; +import getModelName from '../roche/models'; const struct = structJs(); @@ -113,7 +114,7 @@ module.exports = (config) => { if(cfg.deviceInfo.name.startsWith('meter+')) { cfg.deviceInfo.serial = cfg.deviceInfo.model + cfg.deviceInfo.name.slice(6); cfg.deviceInfo.deviceId += `-${cfg.deviceInfo.serial}`; - data.deviceModel = cfg.deviceInfo.model; + data.deviceModel = getModelName(cfg.deviceInfo.model); } else if(env.electron){ cfg.deviceInfo.deviceId += `-${remote.getGlobal('bluetoothDeviceId')}`; } else { @@ -402,6 +403,12 @@ module.exports = (config) => { version: cfg.version, }; + if(cfg.deviceInfo.name.startsWith('meter+')) { + // For Roche meters, we want to store the model number in the upload + // record instead of the model name, to match the USB version + sessionInfo.deviceModel = cfg.deviceInfo.model; + } + cfg.api.upload.toPlatform( data.post_records, sessionInfo, progress, cfg.groupId, (err, result) => { diff --git a/lib/drivers/roche/accuChekUSB.js b/lib/drivers/roche/accuChekUSB.js index 81e5c298d..5136ee608 100644 --- a/lib/drivers/roche/accuChekUSB.js +++ b/lib/drivers/roche/accuChekUSB.js @@ -35,6 +35,8 @@ import { getProductionSpecEntry, } from './utils'; +import getModelName from './models'; + const isBrowser = typeof window !== 'undefined'; // eslint-disable-next-line no-console const debug = isBrowser ? require('bows')('AccuChekUSBDriver') : console.log; @@ -507,27 +509,6 @@ module.exports = (config) => { // timezone is applied across-the-board cfg.tzoUtil = new TZOUtil(cfg.timezone, new Date().toISOString(), []); - const models = [ - { name: 'Aviva Connect', numbers: [483, 484, 497, 498, 499, 500, 502, 685] }, - { name: 'Performa Connect', numbers: [479, 501, 503, 765] }, - { name: 'Guide', numbers: [921, 922, 923, 925, 926, 929, 930, 932] }, - { name: 'Instant (single-button)', numbers: [958, 959, 960, 961, 963, 964, 965] }, - { name: 'Guide Me', numbers: [897, 898, 901, 902, 903, 904, 905] }, - { name: 'Instant (two-button)', numbers: [972, 973, 975, 976, 977, 978, 979, 980] }, - { name: 'Instant S (single-button)', numbers: [966, 967, 968, 969, 970, 971] }, - { name: 'ReliOn Platinum', numbers: [982] }, - ]; - - const getModelName = (number) => { - // eslint-disable-next-line no-restricted-syntax - for (const i in models) { - if (models[i].numbers.indexOf(_.toInteger(number)) >= 0) { - return models[i].name; - } - } - return `Unknown model ${number}`; - }; - return { /* eslint no-param-reassign: [ "error", { "props": true, "ignorePropertyModificationsFor": ["data"] } ] */ diff --git a/lib/drivers/roche/models.js b/lib/drivers/roche/models.js new file mode 100644 index 000000000..6a7edfb90 --- /dev/null +++ b/lib/drivers/roche/models.js @@ -0,0 +1,41 @@ +/* + * == BSD2 LICENSE == + * Copyright (c) 2024, Tidepool Project + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the associated License, which is identical to the BSD 2-Clause + * License as published by the Open Source Initiative at opensource.org. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the License for more details. + * + * You should have received a copy of the License along with this program; if + * not, you can obtain one from Tidepool Project at tidepool.org. + * == BSD2 LICENSE == + */ + +import _ from 'lodash'; + +const models = [ + { name: 'Aviva Connect', numbers: [483, 484, 497, 498, 499, 500, 502, 685] }, + { name: 'Performa Connect', numbers: [479, 501, 503, 765] }, + { name: 'Guide', numbers: [921, 922, 923, 925, 926, 929, 930, 932] }, + { name: 'Instant (single-button)', numbers: [958, 959, 960, 961, 963, 964, 965] }, + { name: 'Guide Me', numbers: [897, 898, 901, 902, 903, 904, 905] }, + { name: 'Instant (two-button)', numbers: [972, 973, 975, 976, 977, 978, 979, 980] }, + { name: 'Instant S (single-button)', numbers: [966, 967, 968, 969, 970, 971] }, + { name: 'ReliOn Platinum', numbers: [982] }, +]; + +const getModelName = (number) => { + // eslint-disable-next-line no-restricted-syntax + for (const i in models) { + if (models[i].numbers.indexOf(_.toInteger(number)) >= 0) { + return models[i].name; + } + } + return `Unknown model ${number}`; +}; + +export default getModelName; From 62b374b59059b4d60a23a992b1424d5a5905dac5 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 15 Oct 2024 10:18:08 +0100 Subject: [PATCH 25/25] v2.59.1-platinum-ble.4 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 72036ddcd..c9dd11da2 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "tidepool-uploader", "productName": "tidepool-uploader", - "version": "2.59.1-platinum-ble.3", + "version": "2.59.1-platinum-ble.4", "description": "Tidepool Project Universal Uploader", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index 04d61f2b4..bf0a76261 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidepool-uploader", - "version": "2.59.1-platinum-ble.3", + "version": "2.59.1-platinum-ble.4", "description": "Tidepool Project Universal Uploader", "private": true, "main": "main.prod.js",