From b0286a6f7f4688d90dac9642df76fa711ee2df46 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 2 Aug 2016 17:38:59 -0700 Subject: [PATCH] updatechecker: ensure box state information is not lost the box and app update checker run in parallel. be sure not to lose the box state information. --- CHANGES | 1 + src/updatechecker.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7fc4718f0..2f3cdf654 100644 --- a/CHANGES +++ b/CHANGES @@ -593,4 +593,5 @@ - Fix migration interface issue - Allow self hosted Cloudron to login to the Cloudron Store - Send mail to self hosted Cloudron admins about OOM and App died errors +- Fix bug where box update emails are sent repeatedly diff --git a/src/updatechecker.js b/src/updatechecker.js index cff9906ba..760c14624 100644 --- a/src/updatechecker.js +++ b/src/updatechecker.js @@ -116,7 +116,7 @@ function checkAppUpdates(callback) { gAppUpdateInfo = { }; var oldState = loadState(); - var newState = { box: oldState.box }; // create new state so that old app ids are removed + var newState = { }; // create new state so that old app ids are removed apps.getAll(function (error, apps) { if (error) return callback(error); @@ -153,6 +153,7 @@ function checkAppUpdates(callback) { iteratorDone(); }); }, function () { + newState.box = loadState().box; // preserve the latest box state information saveState(newState); callback(); });