nightscout / cgm-remote-monitor

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

Error with V15 Profile Editor and v1 API #8114

Closed AndyLow91 closed 10 months ago

AndyLow91 commented 10 months ago

Describe the bug A bug has been found where the user cannot save or edit any profile data in the database, either via the NS profile editor, or via the v1 API.

To Reproduce Deploy NS using V15.0.0 master, or V15.0.0 dev from between October 12th and October 18th. Head over to the profile editor and try to save any change, you will see error and the profile data is not saved to the database.

Additional context From looking through the history, it seems this bug was introduced on October 12th, since dev images from before then work just fine, but no longer work from that point onwards. I haven't pinpointed the exact cause just yet, but I have a hunch that it is to do with the new MongoDB method of updating data. e.g. db.collectionName.update turns into db.collectionName.updateOne().

I haven't fully verified that this is the cause, as there was more than one commit on the same day. It may have something to do with the new Node.js version?

I have confirmed this is the case for DIY users also, tested on Heroku with MongoDB Atlas also.

bedast commented 10 months ago

Can confirm this problem exists with the docker image when used in Northflank with a Northflank MongoDB deployment (6.0) and in a docker compose deployment on a private server running MongoDB 7.0.

Going back to image dev_b1eb27e88bf01d41c54fe378506dce96876789a9 restores functionality.

bewest commented 10 months ago

Suspect this is similar to https://github.com/nightscout/cgm-remote-monitor/pull/8111.

bewest commented 10 months ago

Howdy all, can you please verify if this branch/PR fixes things? https://github.com/nightscout/cgm-remote-monitor/pull/8115

bewest commented 10 months ago

Updated hotfix: 15.0.2. Duplicate: https://github.com/nightscout/cgm-remote-monitor/issues/8117

bewest commented 10 months ago

Believe this is fixed, closing for now.