Context from localfilesystem: flow.get synchronous error

Hi everyone,

Using node-red v1.0.3 with nodejs v10.

I've started to use the context from localFileSystem, for persistence.
I managed to use it and store items with global.set(...) and flow.set(...) inside function nodes.

The bug i've found is when i try to retrieve synchronously from the file contextStore. Using function node i have this:

//ASYNC - working
/*flow.get('count','file',function(err, myCount) {
    if(err){
        node.error(err, msg);
    }else{
        msg.payload=myCount;
        node.send(msg);
    }    
});*/

//SYNC - not working
var a = flow.get('count','file');
msg.payload=a;
return msg;

And i get the following error:
12/12/2019, 15:03:10node: c5ed7f86.e463function : (error)
"Error: Callback must be a function"

I've tracked down the path into the following file from source: @node-red/runtime/lib/nodes/context/localfilesystem.js -> line 248

where it seems that its always expecting a callback function even if its sync:

LocalFileSystem.prototype.get = function(scope, key, callback) {
...
    if(typeof callback !== "function"){
        throw new Error("Callback must be a function");
    }
...

Hope you guys can fix it shortly,

Cheers,
G.B.

If possible, please raise an issue on GitHub with the details so we can take a look.

Thanks

If possible, please raise an issue on GitHub with the details so we can take a look.

Done it. In fact, after I posted here, i was wondering if posting it on Github was more convenient. x)
Thanks

In general it's best to raise it here first, just in case it's something someone already recognises, or has a fix for already.