Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dev #22

Merged
merged 138 commits into from
Oct 5, 2020
Merged
Changes from 1 commit
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
41ac93f
Merge pull request #5113 from nightscout/dev
sulkaharo Dec 17, 2019
f57ccb8
Release 13.0.1 (#5329)
sulkaharo Dec 18, 2019
60be07c
Fix Graph Display Without Recent Devicestatus (#5409)
jpcunningh Jan 6, 2020
ee0b1e8
Update Russian (#5415)
apanasef Jan 6, 2020
0def1f2
Add server teardown ability (#5410)
PetrOndrusek Jan 6, 2020
bb34500
Additional German Translations and corrections (#5405)
herzogmedia Jan 6, 2020
5e47c4d
Fix #5188 - move predictions to bundle and don't render chart on pred…
Bartlomiejsz Jan 6, 2020
ddbda15
Move toolbar and authentication status to partial and include on each…
Bartlomiejsz Jan 6, 2020
4098689
Virtual assistant code simplification (#5400)
inventor96 Jan 11, 2020
4f9f735
Pr/5379 (#5441)
sulkaharo Jan 11, 2020
c49ea37
Volunteer for Polish translations (#5396)
Bartlomiejsz Jan 11, 2020
2f60d8d
Api3 output renderers (#5425)
PetrOndrusek Jan 12, 2020
5c15243
Restore glucose distribution test (#5434)
jakobsandberg Jan 12, 2020
81d926a
Increase coverage of tests on units utility and clean up timeago test…
jakobsandberg Jan 12, 2020
937aa47
Refactor to encapsulate duplicated settings logic (#5426)
jakobsandberg Jan 12, 2020
64663d2
Send coverage reports to Codacy (#5444)
sulkaharo Jan 12, 2020
7dc292e
Resolve unnecessary uses of eslint-ignore (#5436)
jakobsandberg Jan 12, 2020
3a1d9be
Fix eslint errors and add npm script for eslint (#5427)
jakobsandberg Jan 14, 2020
04edbec
Remove redundant checks on entry ID (#5440)
jakobsandberg Jan 14, 2020
d095482
Run CI Action for Pull Requests
sulkaharo Jan 14, 2020
3386ac6
Update DayToDay report for Loop Overrides (#5452)
jonfawcett Jan 18, 2020
baad198
Fix earlier merge error with predictions having moved to the report b…
sulkaharo Jan 18, 2020
6045547
fix brushing loop (#5499)
jpcunningh Feb 1, 2020
c86b890
Update README.md (#5480)
hummelstrand Feb 3, 2020
c0f6b22
Added period of days into headline of glucose distribution and percen…
peterleimbach Feb 3, 2020
82f0076
Move app caching to a service worker (#5504)
sulkaharo Feb 5, 2020
b1ec21c
Added indexes to 'entries' and 'treatments' along with other updates …
a-harrison Feb 5, 2020
765d7f8
Fix: Round interporlated mg/dL value to an integer
sulkaharo Feb 8, 2020
44ab2a7
Plugin to show database size (% of available space or in MiB) (#5496)
dlvoy Feb 10, 2020
65b9f38
Trying to fix random fail of APIv3 tests (#5519)
PetrOndrusek Feb 11, 2020
cd2ad5e
client - mobile - Axis label font is scaled on small screens (#5512)
stephencmorton Feb 16, 2020
77795ca
Split view (#5518)
sulkaharo Feb 16, 2020
729747a
Allow flagging specific settings to be not exposed the /properties an…
sulkaharo Feb 16, 2020
dcf8248
Add more variables to the special list
sulkaharo Feb 16, 2020
43165a0
[DEV][FIX] Fix dbsize plugin to make it hideable again (#5529)
dlvoy Feb 22, 2020
be678c0
Removed duplicate if statement (#5531)
altaired Feb 22, 2020
68fb745
Update Dutch translations (#5532)
Feb 22, 2020
7d95b06
Fix settings test
sulkaharo Feb 22, 2020
32f4791
Update version to 13.1.0
sulkaharo Feb 22, 2020
9611373
Merge branch 'master' into dev for release
sulkaharo Feb 22, 2020
4cdd00d
Fix topbar collapse on small screens (#5562)
sulkaharo Mar 9, 2020
17eb4ae
Option to switch off bolus amount outputs (#5522)
andrew-dixon Apr 14, 2020
7c5a69d
Fix d3 portrait to landscape brush failure (#5638)
jpcunningh May 5, 2020
9236771
Sanitize data from manual careportal entries so only fields with actu…
sulkaharo May 5, 2020
db0e08c
do not redirect to profile editor by default (#5671)
bewest Jun 12, 2020
f3fab56
Fix Issue #5486 - Device Status Days Feature (#5651)
mtfoley Jun 12, 2020
3d6f488
Configurable clock views (#5625)
ireneusz-ptak Jun 12, 2020
5698ae2
Add remote bolus/carbs + otp entry for loop (#5598)
josep1972 Jun 12, 2020
500de79
Sometimes at the very start no profiles provided. (#5591)
GermanBluefox Jun 12, 2020
802d986
Fixes #4991 - Now selects basal profile based day by day (#5572)
fromorbonia Jun 12, 2020
0ae6431
prepare hotfix for MMConnect/EU - 2020-06-28
bewest Jun 28, 2020
f611f1b
bump pointing at right tag
bewest Jun 29, 2020
1062a0d
prepare hotfix for MMConnect/EU - 2020-06-28
bewest Jun 28, 2020
bcd6df2
bump pointing at right tag
bewest Jun 29, 2020
cc1edf2
Merge pull request #5721 from nightscout/wip/bewest/mmconnect-eu
bewest Jun 30, 2020
acf0d39
hotfix attempt 2 - carelink 2020 sso updates
bewest Jun 30, 2020
06982d7
hotfix 3 - attempt 3 at carelink 2020 sso updates
bewest Jun 30, 2020
93c8447
attempt 4 at hotfix for nightscout
bewest Jul 1, 2020
8fba311
hotfix 5 - incorporates latest axios changes
bewest Jul 1, 2020
7283560
Fix for boluscalc issue (#5729)
ireneusz-ptak Jul 2, 2020
9528b79
npm install --save minimed-connect-to-nightscout@^1.4.0
bewest Jul 2, 2020
2fc559e
Change DISPLAY_UNITS to use readENV's default value and added several…
joracine Jul 12, 2020
9b048dd
Fix audit errors, button order (#5694)
sulkaharo Jul 12, 2020
b8e69d9
Fix temporary target cancellation
sulkaharo Aug 18, 2020
356a236
Added documentation on the use of Alpha Testing (#5784)
inventor96 Aug 18, 2020
5ffa5eb
Wip/bewest/mmconnect eu (#5731)
bewest Aug 18, 2020
f4f456a
* Updated several packages to remove issues from NPM audit
sulkaharo Aug 18, 2020
359e6a6
* Limit the default number of profiles returned by the API to fix iss…
sulkaharo Aug 19, 2020
2936559
Upgrade Helmet to 4.0.0
sulkaharo Aug 19, 2020
fd90f4e
CSP and service worker improvements (#5856)
sulkaharo Aug 20, 2020
3e1cc14
Serve the CSP to everyone
sulkaharo Aug 20, 2020
d504a66
Split view CSP support (#5864)
sulkaharo Aug 21, 2020
0c22963
Re-enable CSP configuration (#5867)
sulkaharo Aug 22, 2020
46e3d8f
Merge remote-tracking branch 'official/hotfix/2020-06-28/carelink' in…
bewest Aug 28, 2020
26ebdbd
Bump share2nightscout-bridge plugin
bewest Aug 28, 2020
6613e76
feat Add robots.txt to disallow site crawling
sulkaharo Aug 30, 2020
22d1506
Fix dbsize for usage with Atlas (#5962)
dlvoy Sep 8, 2020
89dfe21
Openaps performance improvement (#5945)
jpcunningh Sep 8, 2020
67fb939
Adapt to MongoDB Atlas (#5893)
aviau Sep 8, 2020
d26091b
Fix Issue #5763 - Change $.ajax to /api/v1/profile (#5704)
mtfoley Sep 8, 2020
0ee3628
Bug fixes for Service Worker (#5970)
pazaan Sep 9, 2020
8019005
Optimize Nightscout database usage (#5947)
sulkaharo Sep 9, 2020
c113424
Bumping version to 14.0.0 given this is a relatively large update and…
sulkaharo Sep 10, 2020
5aef245
Remove logging statements
sulkaharo Sep 10, 2020
ace19e1
fix brushing recursion
Sep 10, 2020
57e33a0
Normalize treatments to support absolute doses from the amount field
sulkaharo Sep 12, 2020
be422f0
Add Loop Carbs foodType, absorptionTime to Reports for ISSUE #5701 (#…
kskandispersonal Sep 12, 2020
14621a4
Update README to point to new docs
sulkaharo Sep 13, 2020
e54a6b8
Merge pull request #5526 from nightscout/dev
sulkaharo Sep 13, 2020
3928565
Fix `Treatments` report for `mmol/L` users
pazaan Sep 13, 2020
0c11bf0
Bump version to 14.0.1
sulkaharo Sep 13, 2020
f04e7d7
Merge pull request #5983 from pazaan/pazaan/fix-iquorice-treatment-re…
sulkaharo Sep 13, 2020
4f85e19
Merge pull request #5984 from nightscout/dev
sulkaharo Sep 13, 2020
663f439
Bump dev to 14.0.2
sulkaharo Sep 13, 2020
e9c09af
Merge branch 'dev' into fix-recursion
Sep 13, 2020
5cdba4a
Merge pull request #5987 from jpcunningh/fix-recursion
sulkaharo Sep 14, 2020
345b171
Merge pull request #5980 from nightscout/absolute_amount
sulkaharo Sep 14, 2020
cd256ab
Serve Last-Modified header for the service worker to help with some b…
sulkaharo Sep 14, 2020
685ae5c
Cleaned old appcache references
sulkaharo Sep 14, 2020
5f0b77b
* Remove unnecessary logging to help with Papertrail limits
sulkaharo Sep 15, 2020
b620164
When merging inserts and updates from the database, ensure we always …
sulkaharo Sep 15, 2020
0a79cb1
Bump treatment delta loading to four hours
sulkaharo Sep 15, 2020
fbe3e9b
One more increase to treatment load time to cover long overrides
sulkaharo Sep 16, 2020
92f23e6
Merge pull request #6004 from nightscout/dev
sulkaharo Sep 16, 2020
90f91c3
* Bump version to 14.0.3
sulkaharo Sep 16, 2020
b62ab3c
Bumped up the number of treatments loaded / day for reporting
sulkaharo Sep 16, 2020
8a1d6bf
Fix reports unit test
sulkaharo Sep 16, 2020
a0043ec
Bump treatments default limit default to 1000 objects for queries tha…
sulkaharo Sep 16, 2020
6e50c23
Merge pull request #6009 from nightscout/dev
sulkaharo Sep 16, 2020
0c7e9bf
* Require created_at for Treatments on insert
sulkaharo Sep 19, 2020
f878ce1
Add support for CGM data and device statuses. Refactor dataloader to …
sulkaharo Sep 20, 2020
a75c5a3
Fix data order for REST API
sulkaharo Sep 20, 2020
1059232
* Add cache update events to websocket API
sulkaharo Sep 21, 2020
54008a7
Remove excess logging
sulkaharo Sep 22, 2020
cde9aa3
Merge pull request #6056 from nightscout/cache_invalidation
sulkaharo Sep 22, 2020
3f1081e
Bump version to .4
sulkaharo Sep 22, 2020
a95ad79
Merge pull request #6078 from nightscout/dev
sulkaharo Sep 23, 2020
de792d2
Bump version to 14.0.5 and fix #6050
sulkaharo Sep 24, 2020
07eee47
Fix Pebble API detecting mmol units from settings
sulkaharo Sep 24, 2020
8ac9734
Make settings parsing whitespace tolerant
sulkaharo Sep 25, 2020
f846165
* Fix security test
sulkaharo Sep 25, 2020
a8956bc
Don't report an error on every reconnect
sulkaharo Sep 25, 2020
d3c1613
Less intimidating error page on start, which also checks for api_secret
sulkaharo Sep 25, 2020
eec131b
Add file missing from last commit
sulkaharo Sep 25, 2020
84c245c
Fix tests
sulkaharo Sep 25, 2020
54a5b35
Remove require statement breaking deploys
sulkaharo Sep 27, 2020
4d2a731
Update --feature-request--.md
sulkaharo Sep 27, 2020
5af8d63
Update --bug-report.md
sulkaharo Sep 27, 2020
6d6cf31
Update --individual-troubleshooting-help.md
sulkaharo Sep 27, 2020
48096fc
Merge branch 'master' into dev
sulkaharo Sep 27, 2020
dfa86a9
Fix memory leak and cache update issues in 14.0.4 (#6133)
sulkaharo Sep 27, 2020
0670c5a
Add error cat to error page
sulkaharo Sep 27, 2020
4ba636d
Fix MONGODB_URI reference in error message
sulkaharo Sep 27, 2020
0dd1254
Bump version to 14.0.6
sulkaharo Sep 28, 2020
a8b53f5
Support uploading device statuses in batches (#6147)
sulkaharo Sep 28, 2020
48f5578
Make empty cache detection a bit more aggressive to account for cache…
sulkaharo Sep 28, 2020
f08f9ea
* Bump version to 14.0.7
sulkaharo Sep 30, 2020
b6bde83
Fixed #5852 - Updated Google Home setup steps (#6195)
inventor96 Oct 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support uploading device statuses in batches (nightscout#6147)
* Support uploading device statuses in batches
* Correctly report batch insertion results
  • Loading branch information
sulkaharo authored Sep 28, 2020
commit a8b53f54e5de973f98e1a8a512a88be8e167375b
70 changes: 45 additions & 25 deletions lib/server/devicestatus.js
Original file line number Diff line number Diff line change
@@ -5,34 +5,51 @@ var find_options = require('./query');

function storage (collection, ctx) {

function create (obj, fn) {

// Normalize all dates to UTC
const d = moment(obj.created_at).isValid() ? moment.parseZone(obj.created_at) : moment();
obj.created_at = d.toISOString();
obj.utcOffset = d.utcOffset();

api().insertOne(obj, function(err, results) {
if (err !== null && err.message) {
console.log('Error inserting the device status object', err.message);
fn(err.message, null);
return;
}
function create (statuses, fn) {

if (!err) {
if (!Array.isArray(statuses)) { statuses = [statuses]; }

if (!obj._id) obj._id = results.insertedIds[0]._id;
const r = [];
let errorOccurred = false;

ctx.bus.emit('data-update', {
type: 'devicestatus'
, op: 'update'
, changes: ctx.ddata.processRawDataForRuntime([obj])
});
}
for (let i = 0; i < statuses.length; i++) {

fn(null, results.ops);
ctx.bus.emit('data-received');
});
const obj = statuses[i];

if (errorOccurred) return;

// Normalize all dates to UTC
const d = moment(obj.created_at).isValid() ? moment.parseZone(obj.created_at) : moment();
obj.created_at = d.toISOString();
obj.utcOffset = d.utcOffset();

api().insertOne(obj, function(err, results) {
if (err !== null && err.message) {
console.log('Error inserting the device status object', err.message);
errorOccurred = true;
fn(err.message, null);
return;
}

if (!err) {

if (!obj._id) obj._id = results.insertedIds[0]._id;
r.push(obj);

ctx.bus.emit('data-update', {
type: 'devicestatus'
, op: 'update'
, changes: ctx.ddata.processRawDataForRuntime([obj])
});

// Last object! Return results
if (i == statuses.length - 1) {
fn(null, r);
ctx.bus.emit('data-received');
}
}
});
};
}

function last (fn) {
@@ -109,7 +126,10 @@ function storage (collection, ctx) {
api.aggregate = require('./aggregate')({}, api);
api.indexedFields = [
'created_at'





, 'NSCLIENT_ID'
];
return api;