Electron autoupdater firing both the 'update-available' and 'update-not-available'


#1

I have an electron app which uses autoupdate. I have registered events:

autoUpdater.addListener(“update-available”, function(event) {
logger.info(“Current version: " + packageJson.version + " New update available”);
logger.info(event);
});

autoUpdater.addListener(“update-not-available”, function(event) {
logger.info(“Current version: " + packageJson.version + " is latest”);
logger.info(event);
});
In the logs i can see:
2017-03-28 22:13:48.005] [INFO] autoUpdaterService - Checking for updates on Tue Mar 28 2017 22:13:48 GMT-0700 (PDT)
[2017-03-28 22:13:48.012] [INFO] autoUpdaterService - Current version: 2.1.23 Checking for update.
[2017-03-28 22:13:48.013] [INFO] autoUpdaterService - { preventDefault: [Function: preventDefault],
sender:
AutoUpdater {
_events:
{ ‘update-available’: [Function],
‘update-downloaded’: [Function],
error: [Function],
‘checking-for-update’: [Function],
‘update-not-available’: [Function] },
_eventsCount: 5 } }
[2017-03-28 22:13:48.208] [INFO] autoUpdaterService - Current version: 2.1.23 New update available
[2017-03-28 22:13:48.208] [INFO] autoUpdaterService - { preventDefault: [Function: preventDefault],
sender:
AutoUpdater {
_events:
{ ‘update-available’: [Function],
‘update-downloaded’: [Function],
error: [Function],
‘checking-for-update’: [Function],
‘update-not-available’: [Function] },
_eventsCount: 5 } }
[2017-03-28 22:13:48.412] [INFO] autoUpdaterService - Current version: 2.1.23 is latest
[2017-03-28 22:13:48.412] [INFO] autoUpdaterService - { preventDefault: [Function: preventDefault],
sender:
AutoUpdater {
_events:
{ ‘update-available’: [Function],
‘update-downloaded’: [Function],
error: [Function],
‘checking-for-update’: [Function],
‘update-not-available’: [Function] },
_eventsCount: 5 } }

This means that for some reason, both the events are getting fired. This is for a mac app and I have the server set up correctly returning 204 in case the version is same and 200 with the update url in case a new update is available.
For some reason this is happening only for some users only while some other users are getting the updates as expected