updatechecker: deep compare update object from appstore
When 'changelog' , 'unstable' fields change the box code is not getting it.
This commit is contained in:
@@ -14,7 +14,8 @@ const apps = require('./apps.js'),
|
||||
debug = require('debug')('box:updatechecker'),
|
||||
notifications = require('./notifications.js'),
|
||||
paths = require('./paths.js'),
|
||||
safe = require('safetydance');
|
||||
safe = require('safetydance'),
|
||||
util = require('util');
|
||||
|
||||
function setUpdateInfo(state) {
|
||||
// appid -> update info { creationDate, manifest }
|
||||
@@ -75,12 +76,12 @@ async function checkBoxUpdates(options) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.box && state.box.version === updateInfo.version) {
|
||||
if (util.isDeepStrictEqual(state.box, updateInfo)) {
|
||||
debug(`checkBoxUpdates: Skipping notification of box update ${updateInfo.version} as user was already notified`);
|
||||
return;
|
||||
}
|
||||
|
||||
debug(`checkBoxUpdates: ${updateInfo.version} is available`);
|
||||
debug(`checkBoxUpdates: ${updateInfo.version} is available. renotification: ${!!state.box}`);
|
||||
|
||||
const changelog = updateInfo.changelog.map((m) => `* ${m}\n`).join('');
|
||||
const message = `Changelog:\n${changelog}\n\nGo to the settings view to update.\n\n`;
|
||||
|
||||
Reference in New Issue
Block a user