From 39856e033ccdadff47f9d1d35b19ad38bc273b0d Mon Sep 17 00:00:00 2001 From: Adrian Marinica Date: Mon, 12 Feb 2018 16:04:56 +0200 Subject: [PATCH] Fix issue with Intercom pod not being updated / installed when GitHub response was not 200 OK --- intercom-plugin/scripts/checkForUpdate.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/intercom-plugin/scripts/checkForUpdate.js b/intercom-plugin/scripts/checkForUpdate.js index 0837814..eaee666 100644 --- a/intercom-plugin/scripts/checkForUpdate.js +++ b/intercom-plugin/scripts/checkForUpdate.js @@ -89,15 +89,15 @@ module.exports = function(context) { updateInfo.lastCheckDate = Date.now(); if (releaseData != null) { - updateInfo.releaseDate = Date.parse(releaseData['published_at']); - updateIntercomIfNeeded(context, updateInfo, function() { - deferral.resolve(); - }); + updateInfo.releaseDate = Date.parse(releaseData['published_at']); } else { - writeUpdateInfo(context, updateInfo, function() { - deferral.resolve(); - }); + // last release date is unavailable, set it to today so that the pod is installed + updateInfo.releaseDate = Date.now(); } + + updateIntercomIfNeeded(context, updateInfo, function() { + deferral.resolve(); + }); }); } else { deferral.resolve();