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

Home screen loses AAPS data from >3 hours ago #4055

Closed
vickster1 opened this issue Nov 8, 2018 · 6 comments
Closed

Home screen loses AAPS data from >3 hours ago #4055

vickster1 opened this issue Nov 8, 2018 · 6 comments
Milestone

Comments

@vickster1
Copy link

vickster1 commented Nov 8, 2018

I’m using Nightscout dev 0.11.0, but was seeing this with 0.10.3 also. I use Dexcom g5 with xdrip+ & AndroidAPS with Dana RS pump.
I see the issue on desktop, iPad & Android phone.

I open my Nightscout page. Data from the last 3 hours is shown correctly, but older data just shows my standard basal profile & my cgm data - no TBRs or carbs/boluses. It also doesn’t show my sage & cage data if they were changed >3 hours ago.
Then it flicks to showing all the info, then flicks back & continues like this. It happens all the time.

cfd515c1-0719-4e20-a3c7-cb60b398f18c
ffed23ae-79d0-4181-9cc9-ee48220fef8f

@DigitalDan1
Copy link
Contributor

I've seen exactly the same thing happen on Windows 10 Chrome and iPhone XS Max.

I'm using Nightscout 0.10.3, Dexcom G6, xDrip+, AndroidAPS (2.0) with Insight pump. I think it could be related to performance because it seems to be worse at certain times when it's generally pretty slow.

@sulkaharo
Copy link
Member

Would you be willing to PM me your Nightscout URL so I can check if I can see errors in the browser console? Sounds like there's some problematic data somewhere that's be causing this - we're on OpenAPS and have no issues with the older data rendering.

@DigitalDan1
Copy link
Contributor

@sulkaharo No errors in the console for me. I've been taking a closer look and tracked it down to the way the client gets new data from the server. When there's a reconnect (roughly every 5 mins for me on Chrome) or hitting reload, the server sends a first chunk of data that includes all the BG values for 48 hours and treatments and device statuses for only the last 3 hours. It then sends a second chunk half a second later with more treatments, etc.

Here's the relevant snippet from websocket.js:

        // send all data upon new connection
        if (lastData && lastData.splitRecent) {
          var split = lastData.splitRecent(Date.now(), times.hours(3).msecs, msecHistory, filterTreatments);
          if (message.status) {
            split.first.status = status(split.first.profiles);
          }
          //send out first chunk
          socket.emit('dataUpdate', split.first);

          //then send out the rest
          setTimeout(function sendTheRest() {
            split.rest.delta = true;
            socket.emit('dataUpdate', split.rest);
          }, 500);
        }

I've seen the second chunk return more than 5,000 treatment records, which takes the browser a long time to process. This is when the user sees just the last 3 hours (like the first screenshot from @vickster1).

Part of the problem for me was duplicate treatment records. Now I've deleted most of them it's a lot faster and I don't really see this problem.

I still think there's a change needed to ensure the browser gets 48 hours of all data, not just BG. Then the second chunk wouldn't be needed at all (by the nightscout browser view anyway).

I may take a closer look when I get time, but for now wanted to share what I'd found.

@sulkaharo
Copy link
Member

Ok I took a peek into @vickster1's Nightscout and looks to me like the cause is AndroidAPS uploading unexpectedly large amount of profile switch treatments - the current codebase assumes this dataset is quite small (entered by hand occasionally) but there's actually almost 600 of these data objects loaded in that Nightscout instance. Most of the profile switches have a duration of 0 as well, which is a bit confusing. @MilosKozak or someone else from the AndroidAPS team - wanna help? The profile code needs to be massively optimized if we want to support Nightscout on the new Android APS behavior.

@sulkaharo
Copy link
Member

Right ok I did actually find a bug in Nightscout - @vickster1 and @DigitalDan1 can you update to latest DEV and see if it improves the situation?

@vickster1
Copy link
Author

That looks to have solved it - thank you Sulka

@sulkaharo sulkaharo added this to the 0.11.0 milestone Nov 20, 2018
@sulkaharo sulkaharo mentioned this issue Feb 7, 2019
sulkaharo added a commit that referenced this issue Feb 7, 2019
Draft release notes for upcoming 0.11 release (currently release candidate phase).

# Changes

Over 360 commits, 89 files changed, +8,428 / −6,569 lines of changes (full list of changes here: 
https://github.com/nightscout/cgm-remote-monitor/pull/4022/commits )

## New features
- Fully secure by default out of the box.  Unsecure access via http is not allowed anymore by default. This might force you to re-authenticate with your `API_SECRET` or token if you were using unsecure access. (@PieterGit )
- No outdated packages with vulnerabilities are being used anymore (@PieterGit ) 
- Add Week to Week report (@jpcunningh, #4123 ) 
- Add Loopalyzer report to analyse looping. Visualize your loop (@lixgbg, #3629 #4235 )
- Add predictions support to Day to Day report (@lixgbg, #3179 )
- Add cgm sensor stop to Careportal (@jpcunningh, #4060)

## Removed features
- remove `mqtt` module, because it had a security issue and was not used
- remove `sgvdata`  module, because it had a security issue, added a lot of complexity and wasn't needed (@PieterGit ). Replacement implementation for CSV and TSV export (@sulkaharo ).

## Improvements
- Fix MongoDB database insert handling. Log error on inserts and don't crash in case the MongoDB disk is full or MongoDB quota is reached (@sulkaharo and @jpcunningh)
- Upgrade packages to recent version, fixing all known security issues with dependencies (@PieterGit)
- Redirect redirect HTTP to HTTPS and implement HSTS (@jweismann, @PieterGit, #4044 and #4010	and #4253 )
- Technical improvement: Migrate from `uglify-js` to `terser-webpack-plugin` (@PieterGit)
- Streamlined Heroku deployment template with more descriptive text and more appropriate defaults for new users (@unsoluble, #4116 )

## Bug fixes
- Fix CGM voltageb battery warning level to match xDrip+ (@jpcunningh, #3954 )
- Fix daylight saving and reloading bug in profile editor, (@DigitalDan1, @Kywalh #4029 and #4074 )
- Reduce the amount of Profile Switch treatments being loaded to fix UI slowdown and Nightscout home screen losing AAPS data from >3 hours ago, (@sulkaharo, @vickster1, #4055 )
- Upgrade to [share2nightscout 0.2.0](https://github.com/nightscout/share2nightscout-bridge/releases/tag/0.2.0). Prevent Nightscout server crashes in case Dexcom server does not respond (@PieterGit, @veryfancy)
- Fix UI so pills are updated immediately after new data is loaded (@sulkaharo)
- Fixes to If-Modified-Since HTTP header handling for BG data (@sulkaharo)

## Documentation and language updates
- Language updates for Danish, Dutch, German, Hebrew, Norwegian, Russian 
- New languages: Japanese, Turkish
- Update Alexa documentation. Note that some Alexa improvements are postponed to Nightscout 0.12 because the Alexa plugin needs refactoring, see #4168 (comment)
- Update IFTTT maker-setup.md docs (@Dave9111, @unsoluble, #4206 )
- Updated various docs, including [CONTRIBUTING](https://github.com/nightscout/cgm-remote-monitor/blob/dev/CONTRIBUTING.md) documentation

# Upgrade notes
- We only allow Nightscout to start with a secure Node JS. 
  - Latest Node 8 LTS (8.15.0 or later) and Latest Node 10 LTS (10.15.1 or later) are recommended and supported. 
  - Latest Node version on Azure (currently 10.14.0) is tolerated, but not recommended
  - Other versions will not start 
- The [rawbg](https://github.com/nightscout/cgm-remote-monitor#rawbg-raw-bg) settings are converted to a single setting tri-state variable.
- We improved security and added several new environment variables such as [INSECURE_USE_HTTP and SECURE_HSTS_HEADER](https://github.com/nightscout/cgm-remote-monitor/#predefined-values-for-your-server-settings-optional)
  - Your site redirects to https by default. If you don't want that or use a Nginx or Apache proxy, set `INSECURE_USE_HTTP` to `true`.
  - We enabled [HTTP Strict Transport Security (HSTS)](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) headers by default, settings `SECURE_HSTS_HEADER` and `SECURE_HSTS_HEADER_*`

## Upgrade notes for Azure users

We recommend Azure users consider migrating their hosting to Heroku, as we've observed Heroku users have significantly less issues with having their sites work reliably. If you want to continue using Azure, change the following configuration variables in Azure before updating to the latest Nightscout version:
```
WEBSITE_NODE_DEFAULT_VERSION=10.14.1
SCM_COMMAND_IDLE_TIMEOUT=300
```

# Install instructions

Install instructions can be found: https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md#install

# Contributors to this release

The release coordination for this release was done by @PieterGit 
We would like to thank the following people for their contribution (in alphabetical order):
@anderser, @apanasef, @balshor, @bewest, @blocklist_twitter, @CaroGo, @cascer1, @cluckj, @danamlewis, @Dave9111, @diabetlum, @herzogmedia, @janrpn, @jasoncalabrese, @jpcunningh, @jweismann, @kenstack, @Kywalh, @lixgbg, @LuminaryXion, @MilosKozak, @mitrei, @PaperT1D, @PieterGit, @unsoluble, @rarneson, @renegadeandy, @scottleibrand, @sulkaharo, @T-o-b-i-a-s, @tynbendad, @unsoluble, @veryfancy, @viq, @wootmasterslick

(if I forgot somebody, please respond)

# TODO

TODO: Translations, Languages with less than 80% will be removed in a future Nightscout version. Currently the following languages are at risk: 
中文(繁體) (zh_tw), Hrvatski (hr), Ελληνικά (el), 한국어 (ko)
See https://gitter.im/nightscout/public?at=5bef2f34de42d46bba766f66

TODO: Fix Codacy errors, https://app.codacy.com/app/Nightscout/cgm-remote-monitor/issues?bid=2452379&filters=W3siaWQiOiJDYXRlZ29yeSIsInZhbHVlcyI6WyJFcnJvciBQcm9uZSJdfV0=

TODO: test dev after all new features are merged for at least two weeks
jozzi05 added a commit to jozzi05/cgm-remote-monitor that referenced this issue Feb 18, 2019
* travis. always build latest lts and latest stable

source: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions

* make travis more clear to build for node js 8 and 10

* add cgm sensor stop

* Update alexa-plugin.md

Add note about using mmol/L

* fix daylight saving bug in profile editor

where From time select lists are showing duplicate/missing entries

* Update Russian

this one looks ok --- there was a typo in my previous pr -- nightscout#3795

* Fixes day to day rendering crashing if data contains a Profile Switch event without a profile

* Previous fix actually appended a blank note, this checks if the data is correct and bails out early if not

* redirect HTTP to HTTPS unless explicitly instructed not to do this redirection

* add support for HSTS and other security related HTTP headers via helmet

* fix for nightscout#4050 (Hyperlink to GVI explanations doesn't work anymore)

* Added new phrase to language.js

* Missed initializing one.

* Grammar and typo updates. External links included where necessary.

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* add contributor table and rerun doctoc

* make links to github profile

* last fixes to CONTRIBUTING.md for tonight

* fix toc

* npm update and manual upgrade to newer versions

* Add jpcunningh to some plugins in CONTRIBUTING

* Reduce the amount of Profile Switch treatments being loaded, to fix nightscout#4055

* After discussing with Milos, actually only guarantee 1 duration 0 profile change object in addition to the default 8 days of treatments

* Wrong keyword in how the limit is applied

* npm update and remove mqtt

* remove sgvdata

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* Add treatments delete id debug.

* Fix devicestatus ObjectID usage.

* Use new objId in api call

* Make ObjectID initialization consistent

* Fix syntax errors in websocket.js

(cherry picked from commit c945c2e)

* update fontello

use  fontello-cli --config ./config.json install and move the files to the staic/glyphs directory

* minor german language changes

* Adding me to list of translators

* improve helmet use

* add default security settings and test

* add default for hsts extendsettings

* fix app.json

* redirect by default

* test

* test csp

* allow 'unsafe-inline' for stylesSrc and scriptSrc

* Turkish language support added

* npm update, disable Content Security Policy headers for now.  Currently Nightscout is not yet compatible with CSP.

* fix settings.test.js

* fix INSECURE_USE_HTTP

* Some correction

* Some corrections

* Some corrections-1

* Some corrections-2

* Some corrections-3

* clean Turkish language support

* Fix identation

* Initial weektoweek

* More updates for weektoweek

* Add weektoweek report to index

* Fix syntax error

* Fix syntax error

* Fix spelling for localeData

* Fix initialization of weekstoshow array

* Initialize new week

* Fix call to prepareHtml

* Make new sgv array for each week

* Fix reference into datastorage array

* Increment currDay as required

* error correction rising/falling

* Add weektoweek debug logs

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* clean Turkish language support

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Fix syntax error

* Fixed index error

* Handle sort order differences

* Sort week before prepareHtml

* Fix syntax error

* Test fix for week partition

* Fix first day of week getting squashed

* Fix it for real this time

* Update app.json

* Fix missing comma

* Adds back the support for loading Entries with CSV and TEXT formats (nightscout#4114)

* Adds back the support for loading Entries with CSV and TEXT formats

* Add default JSON processing MIME type to request formatting

* Cleanly return a blank string if no entries are found

* Restore TSV output extension, better logging

* Initial Japanese Additions

* Don't move to next week if current week is empty

* Fix syntax error

* Color by day and week report specific size and scale

* Comment out some debug

* style format update

* Use from and to dates to set week span for week2week

* Fix newest on top start point

* Fix newest on top

* Don't render week to week if not selected

* Add unit test for weektoweek report

* Remove weektoweek logging code

* Add clean treatments admin tool.

* Fix clean treatments status html id name

* Return status to treatments delete by query

* Add clean entries db admin tool

(cherry picked from commit f56f0b3)

* Correct delete query fields for entries db

* Make devicestatus delete consistent with entries

* cleanup devicestatus delete

* Add isId to api/devicestatus

* Set query options correctly for devicestatus

* Use dateString for devicestatus date field

* Fix devicestatus default date field

* Fix devicestatus delete query handling

* No 'model' concept for devicestatus

* initialize query find by id correctly for devicestatus delete

* Match devicestatus api indention

* Make treatments delete match devicestatus

* Remove old treatments id api path

* Add entries support for delete query

* Remove unused function.

* Removed unused function.

* Add API updates for new delete options.

* Reload data when entries or treatments are deleted

* Fix week 2 week report when not all weekdays are selected

* Fix weekNum calculation

* Make week2week more resilient to date selections

* Fix codacy findings

* Remove more unused variables

* Add new strings to language.js

* Prevent deleting entries or treatments more recent than 2 days ago

* Add unit test for removing old devicestatus records

* Fix codacy finding

* Add unit test for cleantreatmentsdb.js

* Add unit test for cleanentriesdb.js

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Add insert, query, delete test for treatments api

* Add insert, query, delete test for entries api

* Add insert, query, delete test for devicestatus api

* Japanese!

Adding myself as a Japanese Translator. ^_^

* More Japanese

Trying to add an additional update. Having issues with the process. Hopefully I got it this time!

* Add support for Node 10. Upgrade to node 8.14.x . Don't start on older Node versions (except Node 8.11.1 from Azure)

- incorporates nightscout#4134 and nightscout#4129

* allow node ^10.4.2 || ^8.14.1 || ~8.11.1

* fix version typo and add missing parts of PR

* Additions and improvements for Danish language

* Update bgclock.html

Fix for clock showing "24:xx" in 24-hour mode.

* Pad 24h hours with zero

* Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node 8 users.

According to Darren Lee @balshor Node 10.14.1 is available on Azure, see https://gitter.im/nightscout/public?at=5c2a50c70b7fc97caaca6211 or https://gist.github.com/balshor/f3bbb86ff98eeecefc5dd4bdb4118b1b

* update code comments on Node versions

thanks @jpcunningh nightscout#4155 (comment)

* Updated rawbg settings to use a single setting tri-state variable.

* upgrade share2nightscout-bridge to  ~0.2.0-dev-20190102

Use npm released version instead of wip/generalize branch. This version will also make sure Nightscout won't crash if Dexcom servers are down.

* update to released version of share2nightscout-bridge and update webpck-cli to 3.2.0

* Added Japanese

Added Japanese and myself to the list of editors. :) Hope I got the details right!

* add jsdom pinned to 11.11.0 (required for benv unit tests)

* Make weektoweek use SCALE_Y system setting correctly

* Make default scale y initialize correctly

* Cleanup code for initializing weektoweek scale

* Add mmconnect note to the ENABLE description

* Add MMCONNECT_ vars

* Update minimed-connect-to-nightscout reference

* Update moment dependency to match dev

* Removed advanced entries for clarity

Didn't get any feedback either way on this change after multiple enquiries, so going ahead with simplification here. If anyone sorely misses any of these items from the default form, can always put them back in. Also added SHOW_PLUGINS, as it's a useful starter setting.

* Tweak mLab/Mongo wording

* Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (nightscout#4189)

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* Update README.md

Added clarity to ssl config details, and specifics for the use of letsencrypt

* Update README.md

Feedback from @unsoluble

* Fixed the spacing.

I see what you mean. Fixed it. :)

* Semiquote

Used the wrong semiquote.. urg. sorry! All better now.

* spacing check.

* Spacing Test x2

* This should do it!

* Norwegian language corrections and translations

* make Saving profile translatable

* revert minimed-connect version

* two small tweaks

* fix readENVTruthy and make INSECURE_USE_HTTP, SECURE_HSTS_HEADER, SECURE_HSTS_HEADER_* and SECURE_CSP work as expected.

readENVTruthy never returned defaultValue. if not set to on|off|true|false the default value is returned

* npm update

* add missing env

* upgrade to minmum of Node 10.15.1

* fix ident and add extra test to env.test.js

* remove mqtt leftover

* ie8 is not compatible with Terser, so make that explicit

* npm update and integrate terser-webpack-plugin as minimizer

Stick to `terser` version `~3.14.1` instead of `^3.16.0`, because of
```
ERROR in js/bundle.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (E:\path\toc\cgm-remote-monitor\node_modules\terser-webpack-plugin\dist\minify.js:175:23)
```

See terser/terser#254 for details on that bug

* user correct env

* Update IFTTT maker-setup.md docs (nightscout#4206)

* Create test.md

Create folder maker-setup-images

* Add files via upload

Added images to maker-setup-images

* Delete test.md

Delete temp file

* Update maker-setup.md

* Update README.md

Altered the IFTTT section

* Loopalyzer enhanced (nightscout#4215)

* Added table with profiles

First attempt

* Prettified profiles table, ensured last profile displayed

* 1st attempt add showing active profile

* Finalized support for displaying multiple profiles

* Improved deduplication of profiles

* Restored formatting

* Made profiles table a selectable option

* Tolerant in case profile is missing data

* More tolerant on bad profiles

* Refactored the deduplication

Note - needs to be thoroughly tested

* Fixed the profiles table and deduplication of profiles

* Fixed enable/disable of time shift checkbox

* Added explanation of time shift feature

* Added timeshift explanation

Need to run through a last verification before merging to NS,
but my NS currently won't build b/c of npm issues.

* Final Loopalyzer-enhanced

Profiles table works, information on time shift feature added, time shift disabled when only single day.

* Maker docs copyedit & cleanup (nightscout#4256)

* copyedit-and-cleanup

* fix filename typo

* Reimplement Predictions support to Reports (nightscout#4254)

* reimplement nightscout#3179 (Predictions support to Reports)

* add predictions.js

* set version to release candidate 1: 0.11.0-rc1-20190205 (nightscout#4259)

* Tag matafiles with 0.10.3-master-20180805

* Fixes the site for iOS 9 and older

* Name too long, please switch back to BWP

* Create issue templates for NS repo

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* fix contributors (nightscout#4260)

* fix typo in contributors

* fix typo

* Fix auth button ui & update cache busting for App Cache (nightscout#4270)

* small doc fix to comments on Node versions

* Update README.md

* * Fixes authentication dialog UI on Mobile Safari
* Improves app cache busting, so after deploy the app is guaranteed to notice it has to reload content
* Small fix to Finnish language related to auth UI

* Merge master to dev (nightscout#4273)

Merging changes made to Master since last release into Dev for a release

* Update release version

* release 0.11.1 (nightscout#4279)

* Update dev version to 0.11.1

* remove + from version, make way for 0.11.1, upgrade webpack (nightscout#4277)
jozzi05 added a commit to jozzi05/cgm-remote-monitor that referenced this issue Mar 3, 2019
* travis. always build latest lts and latest stable

source: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions

* make travis more clear to build for node js 8 and 10

* add cgm sensor stop

* Update alexa-plugin.md

Add note about using mmol/L

* fix daylight saving bug in profile editor

where From time select lists are showing duplicate/missing entries

* Update Russian

this one looks ok --- there was a typo in my previous pr -- nightscout#3795

* Fixes day to day rendering crashing if data contains a Profile Switch event without a profile

* Previous fix actually appended a blank note, this checks if the data is correct and bails out early if not

* redirect HTTP to HTTPS unless explicitly instructed not to do this redirection

* add support for HSTS and other security related HTTP headers via helmet

* fix for nightscout#4050 (Hyperlink to GVI explanations doesn't work anymore)

* Added new phrase to language.js

* Missed initializing one.

* Grammar and typo updates. External links included where necessary.

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* add contributor table and rerun doctoc

* make links to github profile

* last fixes to CONTRIBUTING.md for tonight

* fix toc

* npm update and manual upgrade to newer versions

* Add jpcunningh to some plugins in CONTRIBUTING

* Reduce the amount of Profile Switch treatments being loaded, to fix nightscout#4055

* After discussing with Milos, actually only guarantee 1 duration 0 profile change object in addition to the default 8 days of treatments

* Wrong keyword in how the limit is applied

* npm update and remove mqtt

* remove sgvdata

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* Add treatments delete id debug.

* Fix devicestatus ObjectID usage.

* Use new objId in api call

* Make ObjectID initialization consistent

* Fix syntax errors in websocket.js

(cherry picked from commit c945c2e)

* update fontello

use  fontello-cli --config ./config.json install and move the files to the staic/glyphs directory

* minor german language changes

* Adding me to list of translators

* improve helmet use

* add default security settings and test

* add default for hsts extendsettings

* fix app.json

* redirect by default

* test

* test csp

* allow 'unsafe-inline' for stylesSrc and scriptSrc

* Turkish language support added

* npm update, disable Content Security Policy headers for now.  Currently Nightscout is not yet compatible with CSP.

* fix settings.test.js

* fix INSECURE_USE_HTTP

* Some correction

* Some corrections

* Some corrections-1

* Some corrections-2

* Some corrections-3

* clean Turkish language support

* Fix identation

* Initial weektoweek

* More updates for weektoweek

* Add weektoweek report to index

* Fix syntax error

* Fix syntax error

* Fix spelling for localeData

* Fix initialization of weekstoshow array

* Initialize new week

* Fix call to prepareHtml

* Make new sgv array for each week

* Fix reference into datastorage array

* Increment currDay as required

* error correction rising/falling

* Add weektoweek debug logs

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* clean Turkish language support

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Fix syntax error

* Fixed index error

* Handle sort order differences

* Sort week before prepareHtml

* Fix syntax error

* Test fix for week partition

* Fix first day of week getting squashed

* Fix it for real this time

* Update app.json

* Fix missing comma

* Adds back the support for loading Entries with CSV and TEXT formats (nightscout#4114)

* Adds back the support for loading Entries with CSV and TEXT formats

* Add default JSON processing MIME type to request formatting

* Cleanly return a blank string if no entries are found

* Restore TSV output extension, better logging

* Initial Japanese Additions

* Don't move to next week if current week is empty

* Fix syntax error

* Color by day and week report specific size and scale

* Comment out some debug

* style format update

* Use from and to dates to set week span for week2week

* Fix newest on top start point

* Fix newest on top

* Don't render week to week if not selected

* Add unit test for weektoweek report

* Remove weektoweek logging code

* Add clean treatments admin tool.

* Fix clean treatments status html id name

* Return status to treatments delete by query

* Add clean entries db admin tool

(cherry picked from commit f56f0b3)

* Correct delete query fields for entries db

* Make devicestatus delete consistent with entries

* cleanup devicestatus delete

* Add isId to api/devicestatus

* Set query options correctly for devicestatus

* Use dateString for devicestatus date field

* Fix devicestatus default date field

* Fix devicestatus delete query handling

* No 'model' concept for devicestatus

* initialize query find by id correctly for devicestatus delete

* Match devicestatus api indention

* Make treatments delete match devicestatus

* Remove old treatments id api path

* Add entries support for delete query

* Remove unused function.

* Removed unused function.

* Add API updates for new delete options.

* Reload data when entries or treatments are deleted

* Fix week 2 week report when not all weekdays are selected

* Fix weekNum calculation

* Make week2week more resilient to date selections

* Fix codacy findings

* Remove more unused variables

* Add new strings to language.js

* Prevent deleting entries or treatments more recent than 2 days ago

* Add unit test for removing old devicestatus records

* Fix codacy finding

* Add unit test for cleantreatmentsdb.js

* Add unit test for cleanentriesdb.js

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Add insert, query, delete test for treatments api

* Add insert, query, delete test for entries api

* Add insert, query, delete test for devicestatus api

* Japanese!

Adding myself as a Japanese Translator. ^_^

* More Japanese

Trying to add an additional update. Having issues with the process. Hopefully I got it this time!

* Add support for Node 10. Upgrade to node 8.14.x . Don't start on older Node versions (except Node 8.11.1 from Azure)

- incorporates nightscout#4134 and nightscout#4129

* allow node ^10.4.2 || ^8.14.1 || ~8.11.1

* fix version typo and add missing parts of PR

* Additions and improvements for Danish language

* Update bgclock.html

Fix for clock showing "24:xx" in 24-hour mode.

* Pad 24h hours with zero

* Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node 8 users.

According to Darren Lee @balshor Node 10.14.1 is available on Azure, see https://gitter.im/nightscout/public?at=5c2a50c70b7fc97caaca6211 or https://gist.github.com/balshor/f3bbb86ff98eeecefc5dd4bdb4118b1b

* update code comments on Node versions

thanks @jpcunningh nightscout#4155 (comment)

* Updated rawbg settings to use a single setting tri-state variable.

* upgrade share2nightscout-bridge to  ~0.2.0-dev-20190102

Use npm released version instead of wip/generalize branch. This version will also make sure Nightscout won't crash if Dexcom servers are down.

* update to released version of share2nightscout-bridge and update webpck-cli to 3.2.0

* Added Japanese

Added Japanese and myself to the list of editors. :) Hope I got the details right!

* add jsdom pinned to 11.11.0 (required for benv unit tests)

* Make weektoweek use SCALE_Y system setting correctly

* Make default scale y initialize correctly

* Cleanup code for initializing weektoweek scale

* Add mmconnect note to the ENABLE description

* Add MMCONNECT_ vars

* Update minimed-connect-to-nightscout reference

* Update moment dependency to match dev

* Removed advanced entries for clarity

Didn't get any feedback either way on this change after multiple enquiries, so going ahead with simplification here. If anyone sorely misses any of these items from the default form, can always put them back in. Also added SHOW_PLUGINS, as it's a useful starter setting.

* Tweak mLab/Mongo wording

* Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (nightscout#4189)

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* Update README.md

Added clarity to ssl config details, and specifics for the use of letsencrypt

* Update README.md

Feedback from @unsoluble

* Fixed the spacing.

I see what you mean. Fixed it. :)

* Semiquote

Used the wrong semiquote.. urg. sorry! All better now.

* spacing check.

* Spacing Test x2

* This should do it!

* Norwegian language corrections and translations

* make Saving profile translatable

* revert minimed-connect version

* two small tweaks

* fix readENVTruthy and make INSECURE_USE_HTTP, SECURE_HSTS_HEADER, SECURE_HSTS_HEADER_* and SECURE_CSP work as expected.

readENVTruthy never returned defaultValue. if not set to on|off|true|false the default value is returned

* npm update

* add missing env

* upgrade to minmum of Node 10.15.1

* fix ident and add extra test to env.test.js

* remove mqtt leftover

* ie8 is not compatible with Terser, so make that explicit

* npm update and integrate terser-webpack-plugin as minimizer

Stick to `terser` version `~3.14.1` instead of `^3.16.0`, because of
```
ERROR in js/bundle.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (E:\path\toc\cgm-remote-monitor\node_modules\terser-webpack-plugin\dist\minify.js:175:23)
```

See terser/terser#254 for details on that bug

* user correct env

* Update IFTTT maker-setup.md docs (nightscout#4206)

* Create test.md

Create folder maker-setup-images

* Add files via upload

Added images to maker-setup-images

* Delete test.md

Delete temp file

* Update maker-setup.md

* Update README.md

Altered the IFTTT section

* Loopalyzer enhanced (nightscout#4215)

* Added table with profiles

First attempt

* Prettified profiles table, ensured last profile displayed

* 1st attempt add showing active profile

* Finalized support for displaying multiple profiles

* Improved deduplication of profiles

* Restored formatting

* Made profiles table a selectable option

* Tolerant in case profile is missing data

* More tolerant on bad profiles

* Refactored the deduplication

Note - needs to be thoroughly tested

* Fixed the profiles table and deduplication of profiles

* Fixed enable/disable of time shift checkbox

* Added explanation of time shift feature

* Added timeshift explanation

Need to run through a last verification before merging to NS,
but my NS currently won't build b/c of npm issues.

* Final Loopalyzer-enhanced

Profiles table works, information on time shift feature added, time shift disabled when only single day.

* Maker docs copyedit & cleanup (nightscout#4256)

* copyedit-and-cleanup

* fix filename typo

* Reimplement Predictions support to Reports (nightscout#4254)

* reimplement nightscout#3179 (Predictions support to Reports)

* add predictions.js

* set version to release candidate 1: 0.11.0-rc1-20190205 (nightscout#4259)

* Tag matafiles with 0.10.3-master-20180805

* Fixes the site for iOS 9 and older

* Name too long, please switch back to BWP

* Create issue templates for NS repo

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* fix contributors (nightscout#4260)

* fix typo in contributors

* fix typo

* Fix auth button ui & update cache busting for App Cache (nightscout#4270)

* small doc fix to comments on Node versions

* Update README.md

* * Fixes authentication dialog UI on Mobile Safari
* Improves app cache busting, so after deploy the app is guaranteed to notice it has to reload content
* Small fix to Finnish language related to auth UI

* Merge master to dev (nightscout#4273)

Merging changes made to Master since last release into Dev for a release

* Update release version

* release 0.11.1 (nightscout#4279)

* Update dev version to 0.11.1

* remove + from version, make way for 0.11.1, upgrade webpack (nightscout#4277)
njmo added a commit to njmo/cgm-remote-monitor that referenced this issue May 6, 2019
* Leap forward... remove npm 5.x support, upgrade packages and also test Node 10 with Travis

- Due to Azure we had several supported npm version 5.6.x, 5.7.x, 5.8.x. Since Node 8.12.0 ships with npm 6.4.x we should stop supporting npm 5.x
- Azure currently does not have Node 8.12.x and probably does not work at this moment. Microsoft should stay current
- upgrades several packages, most notable mongodb
- move file-loader, expose-loader, style-loader to devDependencies
- remove webpack-command because it's not longer maintained and has security issues. Moving to webpack-cli
- upgrade version to 0.11.0-dev-20181022

* mongodb. add newNewUrlParser: true to mongo options

resolves (node:24176) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

* travis. always build latest lts and latest stable

source: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions

* make travis more clear to build for node js 8 and 10

* add cgm sensor stop

* Update alexa-plugin.md

Add note about using mmol/L

* fix daylight saving bug in profile editor

where From time select lists are showing duplicate/missing entries

* Update Russian

this one looks ok --- there was a typo in my previous pr -- nightscout#3795

* Fixes day to day rendering crashing if data contains a Profile Switch event without a profile

* Previous fix actually appended a blank note, this checks if the data is correct and bails out early if not

* redirect HTTP to HTTPS unless explicitly instructed not to do this redirection

* add support for HSTS and other security related HTTP headers via helmet

* fix for nightscout#4050 (Hyperlink to GVI explanations doesn't work anymore)

* Added new phrase to language.js

* Missed initializing one.

* Grammar and typo updates. External links included where necessary.

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* add contributor table and rerun doctoc

* make links to github profile

* last fixes to CONTRIBUTING.md for tonight

* fix toc

* npm update and manual upgrade to newer versions

* Add jpcunningh to some plugins in CONTRIBUTING

* Reduce the amount of Profile Switch treatments being loaded, to fix nightscout#4055

* After discussing with Milos, actually only guarantee 1 duration 0 profile change object in addition to the default 8 days of treatments

* Wrong keyword in how the limit is applied

* npm update and remove mqtt

* remove sgvdata

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* Add treatments delete id debug.

* Fix devicestatus ObjectID usage.

* Use new objId in api call

* Make ObjectID initialization consistent

* Fix syntax errors in websocket.js

(cherry picked from commit c945c2e)

* update fontello

use  fontello-cli --config ./config.json install and move the files to the staic/glyphs directory

* minor german language changes

* Adding me to list of translators

* improve helmet use

* add default security settings and test

* add default for hsts extendsettings

* fix app.json

* redirect by default

* test

* test csp

* allow 'unsafe-inline' for stylesSrc and scriptSrc

* Turkish language support added

* npm update, disable Content Security Policy headers for now.  Currently Nightscout is not yet compatible with CSP.

* fix settings.test.js

* fix INSECURE_USE_HTTP

* Some correction

* Some corrections

* Some corrections-1

* Some corrections-2

* Some corrections-3

* clean Turkish language support

* Fix identation

* Initial weektoweek

* More updates for weektoweek

* Add weektoweek report to index

* Fix syntax error

* Fix syntax error

* Fix spelling for localeData

* Fix initialization of weekstoshow array

* Initialize new week

* Fix call to prepareHtml

* Make new sgv array for each week

* Fix reference into datastorage array

* Increment currDay as required

* error correction rising/falling

* Add weektoweek debug logs

* clean Turkish language support

* Fix syntax error

* Fixed index error

* Handle sort order differences

* Sort week before prepareHtml

* Fix syntax error

* Test fix for week partition

* Fix first day of week getting squashed

* Fix it for real this time

* Update app.json

* Fix missing comma

* Adds back the support for loading Entries with CSV and TEXT formats (nightscout#4114)

* Adds back the support for loading Entries with CSV and TEXT formats

* Add default JSON processing MIME type to request formatting

* Cleanly return a blank string if no entries are found

* Restore TSV output extension, better logging

* Initial Japanese Additions

* Don't move to next week if current week is empty

* Fix syntax error

* Color by day and week report specific size and scale

* Comment out some debug

* style format update

* Use from and to dates to set week span for week2week

* Fix newest on top start point

* Fix newest on top

* Don't render week to week if not selected

* Add unit test for weektoweek report

* Remove weektoweek logging code

* Add clean treatments admin tool.

* Fix clean treatments status html id name

* Return status to treatments delete by query

* Add clean entries db admin tool

(cherry picked from commit f56f0b3)

* Correct delete query fields for entries db

* Make devicestatus delete consistent with entries

* cleanup devicestatus delete

* Add isId to api/devicestatus

* Set query options correctly for devicestatus

* Use dateString for devicestatus date field

* Fix devicestatus default date field

* Fix devicestatus delete query handling

* No 'model' concept for devicestatus

* initialize query find by id correctly for devicestatus delete

* Match devicestatus api indention

* Make treatments delete match devicestatus

* Remove old treatments id api path

* Add entries support for delete query

* Remove unused function.

* Removed unused function.

* Add API updates for new delete options.

* Reload data when entries or treatments are deleted

* Fix week 2 week report when not all weekdays are selected

* Fix weekNum calculation

* Make week2week more resilient to date selections

* Fix codacy findings

* Remove more unused variables

* Add new strings to language.js

* Prevent deleting entries or treatments more recent than 2 days ago

* Add unit test for removing old devicestatus records

* Fix codacy finding

* Add unit test for cleantreatmentsdb.js

* Add unit test for cleanentriesdb.js

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Add insert, query, delete test for treatments api

* Add insert, query, delete test for entries api

* Add insert, query, delete test for devicestatus api

* Japanese!

Adding myself as a Japanese Translator. ^_^

* More Japanese

Trying to add an additional update. Having issues with the process. Hopefully I got it this time!

* Add support for Node 10. Upgrade to node 8.14.x . Don't start on older Node versions (except Node 8.11.1 from Azure)

- incorporates nightscout#4134 and nightscout#4129

* allow node ^10.4.2 || ^8.14.1 || ~8.11.1

* fix version typo and add missing parts of PR

* Additions and improvements for Danish language

* Update bgclock.html

Fix for clock showing "24:xx" in 24-hour mode.

* Pad 24h hours with zero

* Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node 8 users.

According to Darren Lee @balshor Node 10.14.1 is available on Azure, see https://gitter.im/nightscout/public?at=5c2a50c70b7fc97caaca6211 or https://gist.github.com/balshor/f3bbb86ff98eeecefc5dd4bdb4118b1b

* update code comments on Node versions

thanks @jpcunningh nightscout#4155 (comment)

* Updated rawbg settings to use a single setting tri-state variable.

* upgrade share2nightscout-bridge to  ~0.2.0-dev-20190102

Use npm released version instead of wip/generalize branch. This version will also make sure Nightscout won't crash if Dexcom servers are down.

* update to released version of share2nightscout-bridge and update webpck-cli to 3.2.0

* Added Japanese

Added Japanese and myself to the list of editors. :) Hope I got the details right!

* add jsdom pinned to 11.11.0 (required for benv unit tests)

* Make weektoweek use SCALE_Y system setting correctly

* Make default scale y initialize correctly

* Cleanup code for initializing weektoweek scale

* Add mmconnect note to the ENABLE description

* Add MMCONNECT_ vars

* Update minimed-connect-to-nightscout reference

* Update moment dependency to match dev

* Removed advanced entries for clarity

Didn't get any feedback either way on this change after multiple enquiries, so going ahead with simplification here. If anyone sorely misses any of these items from the default form, can always put them back in. Also added SHOW_PLUGINS, as it's a useful starter setting.

* Tweak mLab/Mongo wording

* Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (nightscout#4189)

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* Update README.md

Added clarity to ssl config details, and specifics for the use of letsencrypt

* Update README.md

Feedback from @unsoluble

* Fixed the spacing.

I see what you mean. Fixed it. :)

* Semiquote

Used the wrong semiquote.. urg. sorry! All better now.

* spacing check.

* Spacing Test x2

* This should do it!

* Norwegian language corrections and translations

* make Saving profile translatable

* revert minimed-connect version

* two small tweaks

* fix readENVTruthy and make INSECURE_USE_HTTP, SECURE_HSTS_HEADER, SECURE_HSTS_HEADER_* and SECURE_CSP work as expected.

readENVTruthy never returned defaultValue. if not set to on|off|true|false the default value is returned

* npm update

* add missing env

* upgrade to minmum of Node 10.15.1

* fix ident and add extra test to env.test.js

* remove mqtt leftover

* ie8 is not compatible with Terser, so make that explicit

* npm update and integrate terser-webpack-plugin as minimizer

Stick to `terser` version `~3.14.1` instead of `^3.16.0`, because of
```
ERROR in js/bundle.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (E:\path\toc\cgm-remote-monitor\node_modules\terser-webpack-plugin\dist\minify.js:175:23)
```

See terser/terser#254 for details on that bug

* user correct env

* Update IFTTT maker-setup.md docs (nightscout#4206)

* Create test.md

Create folder maker-setup-images

* Add files via upload

Added images to maker-setup-images

* Delete test.md

Delete temp file

* Update maker-setup.md

* Update README.md

Altered the IFTTT section

* Loopalyzer enhanced (nightscout#4215)

* Added table with profiles

First attempt

* Prettified profiles table, ensured last profile displayed

* 1st attempt add showing active profile

* Finalized support for displaying multiple profiles

* Improved deduplication of profiles

* Restored formatting

* Made profiles table a selectable option

* Tolerant in case profile is missing data

* More tolerant on bad profiles

* Refactored the deduplication

Note - needs to be thoroughly tested

* Fixed the profiles table and deduplication of profiles

* Fixed enable/disable of time shift checkbox

* Added explanation of time shift feature

* Added timeshift explanation

Need to run through a last verification before merging to NS,
but my NS currently won't build b/c of npm issues.

* Final Loopalyzer-enhanced

Profiles table works, information on time shift feature added, time shift disabled when only single day.

* Maker docs copyedit & cleanup (nightscout#4256)

* copyedit-and-cleanup

* fix filename typo

* Reimplement Predictions support to Reports (nightscout#4254)

* reimplement nightscout#3179 (Predictions support to Reports)

* add predictions.js

* set version to release candidate 1: 0.11.0-rc1-20190205 (nightscout#4259)

* Tag matafiles with 0.10.3-master-20180805

* Fixes the site for iOS 9 and older

* Name too long, please switch back to BWP

* Create issue templates for NS repo

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* fix contributors (nightscout#4260)

* fix typo in contributors

* fix typo

* Fix auth button ui & update cache busting for App Cache (nightscout#4270)

* small doc fix to comments on Node versions

* Update README.md

* * Fixes authentication dialog UI on Mobile Safari
* Improves app cache busting, so after deploy the app is guaranteed to notice it has to reload content
* Small fix to Finnish language related to auth UI

* Merge master to dev (nightscout#4273)

Merging changes made to Master since last release into Dev for a release

* Update release version

* release 0.11.1 (nightscout#4279)

* Update dev version to 0.11.1

* remove + from version, make way for 0.11.1, upgrade webpack (nightscout#4277)
njmo added a commit to njmo/cgm-remote-monitor that referenced this issue May 6, 2019
* Leap forward... remove npm 5.x support, upgrade packages and also test Node 10 with Travis

- Due to Azure we had several supported npm version 5.6.x, 5.7.x, 5.8.x. Since Node 8.12.0 ships with npm 6.4.x we should stop supporting npm 5.x
- Azure currently does not have Node 8.12.x and probably does not work at this moment. Microsoft should stay current
- upgrades several packages, most notable mongodb
- move file-loader, expose-loader, style-loader to devDependencies
- remove webpack-command because it's not longer maintained and has security issues. Moving to webpack-cli
- upgrade version to 0.11.0-dev-20181022

* mongodb. add newNewUrlParser: true to mongo options

resolves (node:24176) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

* travis. always build latest lts and latest stable

source: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions

* make travis more clear to build for node js 8 and 10

* add cgm sensor stop

* Update alexa-plugin.md

Add note about using mmol/L

* fix daylight saving bug in profile editor

where From time select lists are showing duplicate/missing entries

* Update Russian

this one looks ok --- there was a typo in my previous pr -- nightscout#3795

* Fixes day to day rendering crashing if data contains a Profile Switch event without a profile

* Previous fix actually appended a blank note, this checks if the data is correct and bails out early if not

* redirect HTTP to HTTPS unless explicitly instructed not to do this redirection

* add support for HSTS and other security related HTTP headers via helmet

* fix for nightscout#4050 (Hyperlink to GVI explanations doesn't work anymore)

* Added new phrase to language.js

* Missed initializing one.

* Grammar and typo updates. External links included where necessary.

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* add contributor table and rerun doctoc

* make links to github profile

* last fixes to CONTRIBUTING.md for tonight

* fix toc

* npm update and manual upgrade to newer versions

* Add jpcunningh to some plugins in CONTRIBUTING

* Reduce the amount of Profile Switch treatments being loaded, to fix nightscout#4055

* After discussing with Milos, actually only guarantee 1 duration 0 profile change object in addition to the default 8 days of treatments

* Wrong keyword in how the limit is applied

* npm update and remove mqtt

* remove sgvdata

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* Add treatments delete id debug.

* Fix devicestatus ObjectID usage.

* Use new objId in api call

* Make ObjectID initialization consistent

* Fix syntax errors in websocket.js

(cherry picked from commit c945c2e)

* update fontello

use  fontello-cli --config ./config.json install and move the files to the staic/glyphs directory

* minor german language changes

* Adding me to list of translators

* improve helmet use

* add default security settings and test

* add default for hsts extendsettings

* fix app.json

* redirect by default

* test

* test csp

* allow 'unsafe-inline' for stylesSrc and scriptSrc

* Turkish language support added

* npm update, disable Content Security Policy headers for now.  Currently Nightscout is not yet compatible with CSP.

* fix settings.test.js

* fix INSECURE_USE_HTTP

* Some correction

* Some corrections

* Some corrections-1

* Some corrections-2

* Some corrections-3

* clean Turkish language support

* Fix identation

* Initial weektoweek

* More updates for weektoweek

* Add weektoweek report to index

* Fix syntax error

* Fix syntax error

* Fix spelling for localeData

* Fix initialization of weekstoshow array

* Initialize new week

* Fix call to prepareHtml

* Make new sgv array for each week

* Fix reference into datastorage array

* Increment currDay as required

* error correction rising/falling

* Add weektoweek debug logs

* clean Turkish language support

* Fix syntax error

* Fixed index error

* Handle sort order differences

* Sort week before prepareHtml

* Fix syntax error

* Test fix for week partition

* Fix first day of week getting squashed

* Fix it for real this time

* Update app.json

* Fix missing comma

* Adds back the support for loading Entries with CSV and TEXT formats (nightscout#4114)

* Adds back the support for loading Entries with CSV and TEXT formats

* Add default JSON processing MIME type to request formatting

* Cleanly return a blank string if no entries are found

* Restore TSV output extension, better logging

* Initial Japanese Additions

* Don't move to next week if current week is empty

* Fix syntax error

* Color by day and week report specific size and scale

* Comment out some debug

* style format update

* Use from and to dates to set week span for week2week

* Fix newest on top start point

* Fix newest on top

* Don't render week to week if not selected

* Add unit test for weektoweek report

* Remove weektoweek logging code

* Add clean treatments admin tool.

* Fix clean treatments status html id name

* Return status to treatments delete by query

* Add clean entries db admin tool

(cherry picked from commit f56f0b3)

* Correct delete query fields for entries db

* Make devicestatus delete consistent with entries

* cleanup devicestatus delete

* Add isId to api/devicestatus

* Set query options correctly for devicestatus

* Use dateString for devicestatus date field

* Fix devicestatus default date field

* Fix devicestatus delete query handling

* No 'model' concept for devicestatus

* initialize query find by id correctly for devicestatus delete

* Match devicestatus api indention

* Make treatments delete match devicestatus

* Remove old treatments id api path

* Add entries support for delete query

* Remove unused function.

* Removed unused function.

* Add API updates for new delete options.

* Reload data when entries or treatments are deleted

* Fix week 2 week report when not all weekdays are selected

* Fix weekNum calculation

* Make week2week more resilient to date selections

* Fix codacy findings

* Remove more unused variables

* Add new strings to language.js

* Prevent deleting entries or treatments more recent than 2 days ago

* Add unit test for removing old devicestatus records

* Fix codacy finding

* Add unit test for cleantreatmentsdb.js

* Add unit test for cleanentriesdb.js

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Add insert, query, delete test for treatments api

* Add insert, query, delete test for entries api

* Add insert, query, delete test for devicestatus api

* Japanese!

Adding myself as a Japanese Translator. ^_^

* More Japanese

Trying to add an additional update. Having issues with the process. Hopefully I got it this time!

* Add support for Node 10. Upgrade to node 8.14.x . Don't start on older Node versions (except Node 8.11.1 from Azure)

- incorporates nightscout#4134 and nightscout#4129

* allow node ^10.4.2 || ^8.14.1 || ~8.11.1

* fix version typo and add missing parts of PR

* Additions and improvements for Danish language

* Update bgclock.html

Fix for clock showing "24:xx" in 24-hour mode.

* Pad 24h hours with zero

* Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node 8 users.

According to Darren Lee @balshor Node 10.14.1 is available on Azure, see https://gitter.im/nightscout/public?at=5c2a50c70b7fc97caaca6211 or https://gist.github.com/balshor/f3bbb86ff98eeecefc5dd4bdb4118b1b

* update code comments on Node versions

thanks @jpcunningh nightscout#4155 (comment)

* Updated rawbg settings to use a single setting tri-state variable.

* upgrade share2nightscout-bridge to  ~0.2.0-dev-20190102

Use npm released version instead of wip/generalize branch. This version will also make sure Nightscout won't crash if Dexcom servers are down.

* update to released version of share2nightscout-bridge and update webpck-cli to 3.2.0

* Added Japanese

Added Japanese and myself to the list of editors. :) Hope I got the details right!

* add jsdom pinned to 11.11.0 (required for benv unit tests)

* Make weektoweek use SCALE_Y system setting correctly

* Make default scale y initialize correctly

* Cleanup code for initializing weektoweek scale

* Add mmconnect note to the ENABLE description

* Add MMCONNECT_ vars

* Update minimed-connect-to-nightscout reference

* Update moment dependency to match dev

* Removed advanced entries for clarity

Didn't get any feedback either way on this change after multiple enquiries, so going ahead with simplification here. If anyone sorely misses any of these items from the default form, can always put them back in. Also added SHOW_PLUGINS, as it's a useful starter setting.

* Tweak mLab/Mongo wording

* Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (nightscout#4189)

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* Update README.md

Added clarity to ssl config details, and specifics for the use of letsencrypt

* Update README.md

Feedback from @unsoluble

* Fixed the spacing.

I see what you mean. Fixed it. :)

* Semiquote

Used the wrong semiquote.. urg. sorry! All better now.

* spacing check.

* Spacing Test x2

* This should do it!

* Norwegian language corrections and translations

* make Saving profile translatable

* revert minimed-connect version

* two small tweaks

* fix readENVTruthy and make INSECURE_USE_HTTP, SECURE_HSTS_HEADER, SECURE_HSTS_HEADER_* and SECURE_CSP work as expected.

readENVTruthy never returned defaultValue. if not set to on|off|true|false the default value is returned

* npm update

* add missing env

* upgrade to minmum of Node 10.15.1

* fix ident and add extra test to env.test.js

* remove mqtt leftover

* ie8 is not compatible with Terser, so make that explicit

* npm update and integrate terser-webpack-plugin as minimizer

Stick to `terser` version `~3.14.1` instead of `^3.16.0`, because of
```
ERROR in js/bundle.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (E:\path\toc\cgm-remote-monitor\node_modules\terser-webpack-plugin\dist\minify.js:175:23)
```

See terser/terser#254 for details on that bug

* user correct env

* Update IFTTT maker-setup.md docs (nightscout#4206)

* Create test.md

Create folder maker-setup-images

* Add files via upload

Added images to maker-setup-images

* Delete test.md

Delete temp file

* Update maker-setup.md

* Update README.md

Altered the IFTTT section

* Loopalyzer enhanced (nightscout#4215)

* Added table with profiles

First attempt

* Prettified profiles table, ensured last profile displayed

* 1st attempt add showing active profile

* Finalized support for displaying multiple profiles

* Improved deduplication of profiles

* Restored formatting

* Made profiles table a selectable option

* Tolerant in case profile is missing data

* More tolerant on bad profiles

* Refactored the deduplication

Note - needs to be thoroughly tested

* Fixed the profiles table and deduplication of profiles

* Fixed enable/disable of time shift checkbox

* Added explanation of time shift feature

* Added timeshift explanation

Need to run through a last verification before merging to NS,
but my NS currently won't build b/c of npm issues.

* Final Loopalyzer-enhanced

Profiles table works, information on time shift feature added, time shift disabled when only single day.

* Maker docs copyedit & cleanup (nightscout#4256)

* copyedit-and-cleanup

* fix filename typo

* Reimplement Predictions support to Reports (nightscout#4254)

* reimplement nightscout#3179 (Predictions support to Reports)

* add predictions.js

* set version to release candidate 1: 0.11.0-rc1-20190205 (nightscout#4259)

* Tag matafiles with 0.10.3-master-20180805

* Fixes the site for iOS 9 and older

* Name too long, please switch back to BWP

* Create issue templates for NS repo

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* fix contributors (nightscout#4260)

* fix typo in contributors

* fix typo

* Fix auth button ui & update cache busting for App Cache (nightscout#4270)

* small doc fix to comments on Node versions

* Update README.md

* * Fixes authentication dialog UI on Mobile Safari
* Improves app cache busting, so after deploy the app is guaranteed to notice it has to reload content
* Small fix to Finnish language related to auth UI

* Merge master to dev (nightscout#4273)

Merging changes made to Master since last release into Dev for a release

* Update release version

* release 0.11.1 (nightscout#4279)

* Update dev version to 0.11.1

* remove + from version, make way for 0.11.1, upgrade webpack (nightscout#4277)
tanja3981 pushed a commit to tanja3981/cgm-remote-monitor that referenced this issue May 21, 2019
jozzi05 added a commit to jozzi05/cgm-remote-monitor that referenced this issue Jun 23, 2019
* travis. always build latest lts and latest stable

source: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions

* make travis more clear to build for node js 8 and 10

* add cgm sensor stop

* Update alexa-plugin.md

Add note about using mmol/L

* fix daylight saving bug in profile editor

where From time select lists are showing duplicate/missing entries

* Update Russian

this one looks ok --- there was a typo in my previous pr -- nightscout#3795

* Fixes day to day rendering crashing if data contains a Profile Switch event without a profile

* Previous fix actually appended a blank note, this checks if the data is correct and bails out early if not

* redirect HTTP to HTTPS unless explicitly instructed not to do this redirection

* add support for HSTS and other security related HTTP headers via helmet

* fix for nightscout#4050 (Hyperlink to GVI explanations doesn't work anymore)

* Added new phrase to language.js

* Missed initializing one.

* Grammar and typo updates. External links included where necessary.

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* add contributor table and rerun doctoc

* make links to github profile

* last fixes to CONTRIBUTING.md for tonight

* fix toc

* npm update and manual upgrade to newer versions

* Add jpcunningh to some plugins in CONTRIBUTING

* Reduce the amount of Profile Switch treatments being loaded, to fix nightscout#4055

* After discussing with Milos, actually only guarantee 1 duration 0 profile change object in addition to the default 8 days of treatments

* Wrong keyword in how the limit is applied

* npm update and remove mqtt

* remove sgvdata

* Fix re-loading bug in profile editor and ensure changes made by the user aren't lost

* Add treatments delete id debug.

* Fix devicestatus ObjectID usage.

* Use new objId in api call

* Make ObjectID initialization consistent

* Fix syntax errors in websocket.js

(cherry picked from commit c945c2e)

* update fontello

use  fontello-cli --config ./config.json install and move the files to the staic/glyphs directory

* minor german language changes

* Adding me to list of translators

* improve helmet use

* add default security settings and test

* add default for hsts extendsettings

* fix app.json

* redirect by default

* test

* test csp

* allow 'unsafe-inline' for stylesSrc and scriptSrc

* Turkish language support added

* npm update, disable Content Security Policy headers for now.  Currently Nightscout is not yet compatible with CSP.

* fix settings.test.js

* fix INSECURE_USE_HTTP

* Some correction

* Some corrections

* Some corrections-1

* Some corrections-2

* Some corrections-3

* clean Turkish language support

* Fix identation

* Initial weektoweek

* More updates for weektoweek

* Add weektoweek report to index

* Fix syntax error

* Fix syntax error

* Fix spelling for localeData

* Fix initialization of weekstoshow array

* Initialize new week

* Fix call to prepareHtml

* Make new sgv array for each week

* Fix reference into datastorage array

* Increment currDay as required

* error correction rising/falling

* Add weektoweek debug logs

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* clean Turkish language support

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Fix syntax error

* Fixed index error

* Handle sort order differences

* Sort week before prepareHtml

* Fix syntax error

* Test fix for week partition

* Fix first day of week getting squashed

* Fix it for real this time

* Update app.json

* Fix missing comma

* Adds back the support for loading Entries with CSV and TEXT formats (nightscout#4114)

* Adds back the support for loading Entries with CSV and TEXT formats

* Add default JSON processing MIME type to request formatting

* Cleanly return a blank string if no entries are found

* Restore TSV output extension, better logging

* Initial Japanese Additions

* Don't move to next week if current week is empty

* Fix syntax error

* Color by day and week report specific size and scale

* Comment out some debug

* style format update

* Use from and to dates to set week span for week2week

* Fix newest on top start point

* Fix newest on top

* Don't render week to week if not selected

* Add unit test for weektoweek report

* Remove weektoweek logging code

* Add clean treatments admin tool.

* Fix clean treatments status html id name

* Return status to treatments delete by query

* Add clean entries db admin tool

(cherry picked from commit f56f0b3)

* Correct delete query fields for entries db

* Make devicestatus delete consistent with entries

* cleanup devicestatus delete

* Add isId to api/devicestatus

* Set query options correctly for devicestatus

* Use dateString for devicestatus date field

* Fix devicestatus default date field

* Fix devicestatus delete query handling

* No 'model' concept for devicestatus

* initialize query find by id correctly for devicestatus delete

* Match devicestatus api indention

* Make treatments delete match devicestatus

* Remove old treatments id api path

* Add entries support for delete query

* Remove unused function.

* Removed unused function.

* Add API updates for new delete options.

* Reload data when entries or treatments are deleted

* Fix week 2 week report when not all weekdays are selected

* Fix weekNum calculation

* Make week2week more resilient to date selections

* Fix codacy findings

* Remove more unused variables

* Add new strings to language.js

* Prevent deleting entries or treatments more recent than 2 days ago

* Add unit test for removing old devicestatus records

* Fix codacy finding

* Add unit test for cleantreatmentsdb.js

* Add unit test for cleanentriesdb.js

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Update Makefile

Regenerated the Codacy Token and gave the new token to Travis

* Add insert, query, delete test for treatments api

* Add insert, query, delete test for entries api

* Add insert, query, delete test for devicestatus api

* Japanese!

Adding myself as a Japanese Translator. ^_^

* More Japanese

Trying to add an additional update. Having issues with the process. Hopefully I got it this time!

* Add support for Node 10. Upgrade to node 8.14.x . Don't start on older Node versions (except Node 8.11.1 from Azure)

- incorporates nightscout#4134 and nightscout#4129

* allow node ^10.4.2 || ^8.14.1 || ~8.11.1

* fix version typo and add missing parts of PR

* Additions and improvements for Danish language

* Update bgclock.html

Fix for clock showing "24:xx" in 24-hour mode.

* Pad 24h hours with zero

* Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node 8 users.

According to Darren Lee @balshor Node 10.14.1 is available on Azure, see https://gitter.im/nightscout/public?at=5c2a50c70b7fc97caaca6211 or https://gist.github.com/balshor/f3bbb86ff98eeecefc5dd4bdb4118b1b

* update code comments on Node versions

thanks @jpcunningh nightscout#4155 (comment)

* Updated rawbg settings to use a single setting tri-state variable.

* upgrade share2nightscout-bridge to  ~0.2.0-dev-20190102

Use npm released version instead of wip/generalize branch. This version will also make sure Nightscout won't crash if Dexcom servers are down.

* update to released version of share2nightscout-bridge and update webpck-cli to 3.2.0

* Added Japanese

Added Japanese and myself to the list of editors. :) Hope I got the details right!

* add jsdom pinned to 11.11.0 (required for benv unit tests)

* Make weektoweek use SCALE_Y system setting correctly

* Make default scale y initialize correctly

* Cleanup code for initializing weektoweek scale

* Add mmconnect note to the ENABLE description

* Add MMCONNECT_ vars

* Update minimed-connect-to-nightscout reference

* Update moment dependency to match dev

* Removed advanced entries for clarity

Didn't get any feedback either way on this change after multiple enquiries, so going ahead with simplification here. If anyone sorely misses any of these items from the default form, can always put them back in. Also added SHOW_PLUGINS, as it's a useful starter setting.

* Tweak mLab/Mongo wording

* Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (nightscout#4189)

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* Update README.md

Added clarity to ssl config details, and specifics for the use of letsencrypt

* Update README.md

Feedback from @unsoluble

* Fixed the spacing.

I see what you mean. Fixed it. :)

* Semiquote

Used the wrong semiquote.. urg. sorry! All better now.

* spacing check.

* Spacing Test x2

* This should do it!

* Norwegian language corrections and translations

* make Saving profile translatable

* revert minimed-connect version

* two small tweaks

* fix readENVTruthy and make INSECURE_USE_HTTP, SECURE_HSTS_HEADER, SECURE_HSTS_HEADER_* and SECURE_CSP work as expected.

readENVTruthy never returned defaultValue. if not set to on|off|true|false the default value is returned

* npm update

* add missing env

* upgrade to minmum of Node 10.15.1

* fix ident and add extra test to env.test.js

* remove mqtt leftover

* ie8 is not compatible with Terser, so make that explicit

* npm update and integrate terser-webpack-plugin as minimizer

Stick to `terser` version `~3.14.1` instead of `^3.16.0`, because of
```
ERROR in js/bundle.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (E:\path\toc\cgm-remote-monitor\node_modules\terser-webpack-plugin\dist\minify.js:175:23)
```

See terser/terser#254 for details on that bug

* user correct env

* Update IFTTT maker-setup.md docs (nightscout#4206)

* Create test.md

Create folder maker-setup-images

* Add files via upload

Added images to maker-setup-images

* Delete test.md

Delete temp file

* Update maker-setup.md

* Update README.md

Altered the IFTTT section

* Loopalyzer enhanced (nightscout#4215)

* Added table with profiles

First attempt

* Prettified profiles table, ensured last profile displayed

* 1st attempt add showing active profile

* Finalized support for displaying multiple profiles

* Improved deduplication of profiles

* Restored formatting

* Made profiles table a selectable option

* Tolerant in case profile is missing data

* More tolerant on bad profiles

* Refactored the deduplication

Note - needs to be thoroughly tested

* Fixed the profiles table and deduplication of profiles

* Fixed enable/disable of time shift checkbox

* Added explanation of time shift feature

* Added timeshift explanation

Need to run through a last verification before merging to NS,
but my NS currently won't build b/c of npm issues.

* Final Loopalyzer-enhanced

Profiles table works, information on time shift feature added, time shift disabled when only single day.

* Maker docs copyedit & cleanup (nightscout#4256)

* copyedit-and-cleanup

* fix filename typo

* Reimplement Predictions support to Reports (nightscout#4254)

* reimplement nightscout#3179 (Predictions support to Reports)

* add predictions.js

* set version to release candidate 1: 0.11.0-rc1-20190205 (nightscout#4259)

* Tag matafiles with 0.10.3-master-20180805

* Fixes the site for iOS 9 and older

* Name too long, please switch back to BWP

* Create issue templates for NS repo

* Update CONTRIBUTING.md

Added notes on expectations on Pull Requests

* Update CONTRIBUTING.md

Added note on README updates

* Update CONTRIBUTING.md

Clarified plugins, bug fixing parts

* Update --bug-report.md

Adding auto-labeling of bugs with the bug label

* fix contributors (nightscout#4260)

* fix typo in contributors

* fix typo

* Fix auth button ui & update cache busting for App Cache (nightscout#4270)

* small doc fix to comments on Node versions

* Update README.md

* * Fixes authentication dialog UI on Mobile Safari
* Improves app cache busting, so after deploy the app is guaranteed to notice it has to reload content
* Small fix to Finnish language related to auth UI

* Merge master to dev (nightscout#4273)

Merging changes made to Master since last release into Dev for a release

* Update release version

* release 0.11.1 (nightscout#4279)

* Update dev version to 0.11.1

* remove + from version, make way for 0.11.1, upgrade webpack (nightscout#4277)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants