Context not updating on localfilesystem

I hope as ever that I have not done something stupid but here goes ...

Raspberry pi running node-red 0.20.7. I have set up Global Context storage to 'localfilesystem'

contextStorage: {
       default: {

in settings.js.

The relevant directory structure has been created and I can see the data stored in global.json. An extract is as follows:

    "stats": {
        "devices": [
                "name": "Room Left",
                "address": "X10_DOOR/0X0B0466",
                "value": "Normal",
                "date": "08/10/2019",
                "time": "16:03:33",
                "visible": true

But as you can see from the date (UK) - it is not being updated.

I know the global itself is updated as I use it for a status displays via MQTT requests, and the latest date should be today. If I re-boot the pi - the data I get is this out of date version.

Any ideas where I should look for the problem?


How are you changing the date? how/when are you storing the global?

The persistant data will only change when you set it to something new.

can you provide your flow and indicate what node is updating the persistant data?

OK - it was me!:crazy_face:

Thanks @zenofmud for making me review it with fresh thoughts.:+1:

I am using my own js routines to update the global context data. Since I could see the values being updated, it never occurred to me that I should also use global.set() to ensure that the context data is refreshed.

I added a global.set() to the function node - et voila!!