diff --git a/src/test/updatechecker-test.js b/src/test/updatechecker-test.js index 74e749a2a..462ad2dd9 100644 --- a/src/test/updatechecker-test.js +++ b/src/test/updatechecker-test.js @@ -313,6 +313,20 @@ describe('updatechecker - checkAppUpdates', function () { }); }); + it('does not send mail for patch releases', function (done) { + nock.cleanAll(); + + var scope = nock('http://localhost:4444') + .post('/api/v1/appupdates') + .reply(200, { appVersions: { 'io.cloudron.app': { manifest: { version: '1.0.1' } } } }); + + updatechecker.checkAppUpdates(function (error) { + expect(!error).to.be.ok(); + expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '1.0.1' } } }); // got the update + checkMails(0, done); // but no email sent since patch release + }); + }); + it('does not offer old version', function (done) { nock.cleanAll(); diff --git a/src/updatechecker.js b/src/updatechecker.js index f06dd12be..4f0b3a34a 100644 --- a/src/updatechecker.js +++ b/src/updatechecker.js @@ -173,7 +173,7 @@ function checkAppUpdates(callback) { return iteratorDone(); } - if (semver.satisfies(newState[id].version, '~' + app.manifest.version)) { + if (semver.satisfies(newState[id], '~' + app.manifest.version)) { debug('Skipping notification of box update as this is a patch release'); } else { mailer.appUpdateAvailable(app, updateInfo[id]);