Read the statement by Michael Teeuw here.
I possibly found an updateNotification bug that may be responsible for the out of memory errors
-
@mlcampbe yes, MM screen refresh causes LOTS of problems… most modules cannot handle this…
(the MM design is that it should never be done)access remote OR local but not both…
-
@mlcampbe i don’t think u needed to save the payload… i think clearing the array should be enough…
the payload should be the same, as the module.js is just getting a list of installed/running modules.
actually a more simple way, is check to see if the timer is not started,. then allow config, else skip it.
then it will only be done once…basically change this
socketNotificationReceived: function (notification, payload) { if (notification === "CONFIG") { this.config = payload; } else if(notification === "MODULES") { this.configureModules(payload); this.preformFetch(); } },
to this
socketNotificationReceived: function (notification, payload) { if (notification === "CONFIG") { this.config = payload; } else if(notification === "MODULES") { // if refresh cycle timer not yet started if(this.updateTimer==null ){ this.configureModules(payload); this.preformFetch(); } } },
this still leaves a tiny window, if the initial cycle is running, and you start another via refresh…
so, this calls for another flag.
updateProcessStarted: false
and thissocketNotificationReceived: function (notification, payload) { if (notification === "CONFIG") { this.config = payload; } else if(notification === "MODULES") { // if this is the 1st time thru the update check process if(this.updateProcessStarted==false ){ this.updateProcessStarted=true; this.configureModules(payload); this.preformFetch(); } } },
-
Sam, when I cleared the simpleGits array only then nothing was refreshing. That could have been where I was clearing it though. It seems that as you mentioned the configureModules was only getting called 1 time when initially loaded unless of course I accessed MM via the browser which called everything again.
For now I am happy with my solution as it is working for both auto refreshes via the updateInterval and for browser access from another machine. Its not any more code than you added but just done a different way. It may not be quite as efficient as it builds the simpleGits array everytime it is called but I don’t plan to call it more than once every 6 hrs anyway so that is not going to be a problem.
It is yet to be seen if this fixes the out of memory errors that were being seen though. I’ll have to leave it running for a day or 2 and check to see what happens.
-
ok, I have mine running too… shows 1 update available…
-
This post is deleted! -
I’ve spent the day looking over the module, and there are a number of bugs that had to be fixed.
the design is synchronous calls to simple-gits module, but simple-gits uses promises under the covers, so everything is actually async, which exposes some potential data corruption
also the module.js overwrites the this.status pointer on each notification from the helper, before checking if the data is useful (behind > 0)… which yanks the data out from under getDom().
and getDom() processes for each good data message, overlaying anything prior… only one module status shows
i am testing fixes for all of that…
-
Make a pull request ;)
-
@ezarlive testing… before sending the code