summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/update
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-06-19 18:39:27 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-02 18:58:47 +0100
commit216bd0a9580417e846aa357e3bc2a6dcfd5b1409 (patch)
treec92525b690bb2fae0b8e3b61139d72517db14dbb /toolkit/mozapps/update
parentd795f4c2c2dfee7d6c1f86116e3213c8cd7c109f (diff)
downloadUXP-216bd0a9580417e846aa357e3bc2a6dcfd5b1409.tar
UXP-216bd0a9580417e846aa357e3bc2a6dcfd5b1409.tar.gz
UXP-216bd0a9580417e846aa357e3bc2a6dcfd5b1409.tar.lz
UXP-216bd0a9580417e846aa357e3bc2a6dcfd5b1409.tar.xz
UXP-216bd0a9580417e846aa357e3bc2a6dcfd5b1409.zip
Fix toolkit update logic to prevent update loops.
Only consider equal appversion to be "update available" if BuildID is present AND greater than current. This resolves #13.
Diffstat (limited to 'toolkit/mozapps/update')
-rw-r--r--toolkit/mozapps/update/nsUpdateService.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
index 10eb1d100..e23ab3f40 100644
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -2395,14 +2395,16 @@ UpdateService.prototype = {
let lastCheckCode = AUSTLMY.CHK_NO_COMPAT_UPDATE_FOUND;
updates.forEach(function(aUpdate) {
- // Ignore updates for older versions of the application and updates for
- // the same version of the application with the same build ID.
+ // Ignore updates for older versions of the applications and updates for
+ // the same version or build id of the application
if (vc.compare(aUpdate.appVersion, Services.appinfo.version) < 0 ||
- vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
- aUpdate.buildID == Services.appinfo.appBuildID) {
+ (vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
+ aUpdate.buildID <= Services.appinfo.appBuildID) ||
+ (vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
+ aUpdate.buildID == undefined)) {
LOG("UpdateService:selectUpdate - skipping update because the " +
- "update's application version is less than the current " +
- "application version");
+ "update's application version is less than or equal to " +
+ "the current application version.");
lastCheckCode = AUSTLMY.CHK_UPDATE_PREVIOUS_VERSION;
return;
}