nightscout / cgm-remote-monitor

nightscout web monitor
GNU Affero General Public License v3.0
2.43k stars 71.81k forks source link

2 Issues in NS DEV v15.0.0: 1) Profile editor shows only active profile. 2) [Fixed 16.04.23] Wrong Basal in Overview, but correct in reports. #7947

Closed Alamo04 closed 1 year ago

Alamo04 commented 1 year ago

Profile Editor: In NS Editor is only the active profile shown/useable. I have stored 5 profiles there.

I use AAPS, so its not a problem for me, but perhaps for others.

Screenshot 2023-03-08 230000

######################################

NS DEV v15.0.0 shows zero temp in overview as profile basal value: NighScout: grafik

AAPS: Screenshot_20230308-231153

System: Pixel 5, AAPS Dev, G6 Boyda, DanaRS

samspycher commented 1 year ago

To expand on this a bit, the UI does show the necessary buttons, but only for a short moment:

https://user-images.githubusercontent.com/1706327/229285697-6d23937b-86a5-4a4b-a6fc-1284cd17f894.mp4

Also, browser dev tools show these two errors:

CleanShot 2023-04-01 at 13 17 33@2x

szantos commented 1 year ago

To expand on this a bit, the UI does show the necessary buttons, but only for a short moment:

Same problem here - unable to create/copy/delete profiles.

Alamo04 commented 1 year ago

2) Fixed by myself with following API3 settings:

Now also zero temp's in the past will be showing in the main screen

Still a small bug remaining for that: If zero temp was cancelled, the NS main page switches and shows that zero time as standard basal, it needs up to 10-15 minutes to show that zero time correctly.

parapenT1sta commented 1 year ago

To expand on this a bit, the UI does show the necessary buttons, but only for a short moment:

CleanShot.2023-04-01.at.13.11.13.mp4 Also, browser dev tools show these two errors:

CleanShot 2023-04-01 at 13 17 33@2x

I have the same issue.

Alamo04 commented 1 year ago

1) Profile editor shows only active profile

Still not fixed. Another Bug in that case is, that NS shows sometimes the wrong profile as active and not my current active AAPS profile. Have to save and activate my actual running profile again in AAPS to update it in NS.

parapenT1sta commented 1 year ago

@sulkaharo Can you help?

zehnBE commented 1 year ago

i have try a littlebit and the problem comes only, when the "remember me" Checkbox on the login was active. If you dont use "remember me"-Checkbox on login and call the /profile page, it works.

without cookie login the console says

... Done initeditor() index.js:1322 got dataUpdate Thu Jul 20 2023 17:34:32 GMT+0200 (Mitteleuropäische Sommerzeit) chart.js:314 Unable to find element for #chartContainer hashauth.js:47 Authentication passed. index.js:1322 got dataUpdate Thu Jul 20 2023 17:34:32 GMT+0200 (Mitteleuropäische Sommerzeit)

-> works

with cookie login

the last "hashauth.js:47 Authentication passed." is missing and then it does not load/remove the data and is broken.

That is what i found out.

Alamo04 commented 1 year ago

@zehnBe Testet it on my Tablet, didn't work. Test with deleted cookies, also didn't help. Will test it later on my PC.

sulkaharo commented 1 year ago

Hi! It's bit difficult to say exactly what the issue is here given there's at least three different issues mentioned. I'm not using AAPS so it's impossible for me to reproduce any related issues. The profile editor shows the latest profile stored in the profile collection, so this sounds like AAPS is not necessarily always updating the profile data to match the profile in Nigthscout when the profile has been changed.

bewest commented 1 year ago

Additional note; Nightscout uses the localstorage API, not the cookie API for storing the api secret.

parapenT1sta commented 1 year ago

Hi! It's bit difficult to say exactly what the issue is here given there's at least three different issues mentioned. I'm not using AAPS so it's impossible for me to reproduce any related issues. The profile editor shows the latest profile stored in the profile collection, so this sounds like AAPS is not necessarily always updating the profile data to match the profile in Nigthscout when the profile has been changed.

About the issue number 1 from this topic. In fact before we were able to switch profiles in NS Profile editor but now is only showing the active profile. AAPS can receive profile switch from NS but with this bug we can't do it. (check the 4th option from the screenshot)

Screenshot_20230720_193655_AAPS

Alamo04 commented 1 year ago

Hi! It's bit difficult to say exactly what the issue is here given there's at least three different issues mentioned. I'm not using AAPS so it's impossible for me to reproduce any related issues. The profile editor shows the latest profile stored in the profile collection, so this sounds like AAPS is not necessarily always updating the profile data to match the profile in Nigthscout when the profile has been changed.

AAPS uploads every Profile Switch and also every changes in an active Profile, in that moment you save, or activate it. In that case this profile will now be shown in Profile Manager and the old one is gone, or not longer avaible to choose in NS.

This will become a bad issue for parents, to manage their diabetic kids from home, or work. They mostly have different Profiles, for different situations... and are using NS to do that.

zehnBE commented 1 year ago

https://github.com/nightscout/cgm-remote-monitor/assets/40665283/1927cb93-ed97-44a1-b006-aee90d0d02ef

on my side, after the first login, it works. But when you have activate "remember my device" and reload, it does not work then.

Can it be, that it comes from the new timezone detection code and not the "auth" process?

Alamo04 commented 1 year ago

@zehnBE As I say, that didn't work for me. Don't know why not, because I'm also on 10be Server. Also tryed to delete all profile switches, also didn't change anything.

Also don't know why you see the entrys in that profile, while the Device authentication is open. It has to be empty.

[EDIT 24.07.2023] OK, now I got it.

samspycher commented 1 year ago

Regarding the original issue mentioned in the OP, you can force display of profile selection and history buttons, which works well enough for us for now.

I have not explored and unfortunately have no clue as to why these toggles turn out to misbehave for us:

$('#pe_history').toggle(client.settings.extendedSettings.profile && client.settings.extendedSettings.profile.history);
$('#pe_multiple').toggle(client.settings.extendedSettings.profile && client.settings.extendedSettings.profile.multiple);

But it may be helpful to know that the associated buttons seem to flicker, so while loading they go from the default display:none to display:block but then unfortunately back again.

Alamo04 commented 1 year ago

Issue 2 fixed)

zehnBE has fixed it for me, so both issues are fixed now, for me . Redeploy was needed after this fix.

zehnBE commented 1 year ago

i do only pushed the changes from samspycher on.