Issue 1:
Preflight Checklist

[ I have read the Contributing Guidelines for this project. ]

[ I agree to follow the Code of Conduct that this project adheres to. ]

[ I have searched the issue tracker for an issue that matches the one I want to file, without success.]

Issue Details

Electron Version:

Electron v11.0.4

Operating System:

Windows 10

Expected Behavior

I am using net.request. usually net.request will return set-cookie in the response only in 200 response. In case of redirect response like 301, 304, the set-cookie header will not be returned even though it exists on the header. It should be returned.

Actual Behavior

set-cookie response header is not coming in the response

Please check this link. Already someone asked the same issue..

#23865

Issue 2:
Electron Version:

-4.0.4

Operating System:

-Window 10

Expected Behavior

I'm checking for update in every 3 hours. So If update is available I'll create a dialog.showMessageBox popup and it will notify the user that update is available do you want to download. Again in next 3 hours the popup will appear but this time 2 popups will appear and in next 3 hour 3 and so on.

Actual Behavior

When popup is hide it should removed from the memory.

To Reproduce

Screenshots

Additional Information

main.js

const {app, BrowserWindow, dialog, ipcMain} = require('electron'); // Load electron and import it's modules
const {autoUpdater} = require('electron-updater'); // electron updater to update the application on run-time.
const log = require('electron-log');
const downloadProgressBar = require('electron-progressbar'); // progressbar to show update downloading process.
console.dir(dialog.showMessageBox)
const appData = require('./config.js');

let CONFIG_DATA = appData.module;
const server = 'http://localhost:8080';

let isPageLoaded = false;
let updateAvailabelPopup = null;
let errorPopup = null;
let progressWindow = null;
let installUpdatePopup = null;

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win;
let downloadProgress = 0;
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';

autoUpdater.autoDownload = CONFIG_DATA.updateAutoDownload; // update auto download is false.
autoUpdater.autoInstallOnAppQuit = CONFIG_DATA.autoInstallOnAppQuit; // app install on quit automatically is false.
//autoUpdater.channel = 'latest';

process.env.NODE_ENV = CONFIG_DATA.developmentMode; // set mode to production.

function createWindow () {
// Create the browser window.

win = new BrowserWindow({width: CONFIG_DATA.windowWidth, height: CONFIG_DATA.windowHeight, fullscreen: CONFIG_DATA.isFullScreenScreen});

win.setMenu(null);

// Open the DevTools.
win.webContents.openDevTools();

// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null;
});
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
autoUpdater.setFeedURL(server);
autoUpdater.checkForUpdates(); // Initiate the checking for latest update.

setInterval(() => {
autoUpdater.checkForUpdates();
}, 1000 * 60 * 3);

createWindow(); // Create the game window.
});

// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit();
}
});

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow();
}
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

app.on("test",(arg) => {
win.webContents.print({silent: false});
});

// check if update is availabel.

autoUpdater.on('checking-for-update', () => {
// If update is availabel download it now or later.
console.log('checking for update......!!!!!!')
autoUpdater.on('update-available', (ev,info) => {
updateAvailabelPopup = dialog.showMessageBox({
type: 'info',
title: 'Update Availabel',
messgae: 'A new Update availabel. Please update now.',
buttons: ['Update', 'No'],
cancelId: 1
}, (index, val) => {
if(index === 1){
// if user cancel update load the game.
if(!isPageLoaded)
loadPage();
return;
}else{
// If update have any error.
autoUpdater.on('error', (ev, err) => {
win.quit();
errorPopup = dialog.showMessageBox({
type: 'info',
title: 'Error',
message: 'Error...',
detail: err,
cancelId: 1
});
});
// Download the update.
autoUpdater.downloadUpdate();

//if( process.platform !== 'win32'){
progressWindow = new downloadProgressBar({
title: 'Downloading Update...',
text: 'Downloading Update. Please Wait...',
detail: 'Wait...',
indeterminate: CONFIG_DATA.progressType
})

autoUpdater.on('download-progress', ({percent}) => {
console.log('download progress')
progressWindow.value = percent;
downloadProgress = percent;
});

progressWindow.on('progress', (value) => {
progressWindow.detail = downloadProgress.toFixed(1);
})

.on('aborted', function() {
if(win)	win.quit();
});
//}

// Update is downloaded.
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
progressWindow.setCompleted();
console.log('update downloaded')
const dialogOptns = {
type: 'info',
title: 'Update Ready..!!',
message: process.platform === 'win32' ? releaseNotes : releaseName,
buttons: ['Yes', 'Later']	,
cancelId: 1
}

installUpdatePopup = dialog.showMessageBox(dialogOptns, (response) => {
if(response === 0) autoUpdater.quitAndInstall();
else if(!isPageLoaded) loadPage();

})
})
}
})
});

// Load the game if update is not availabel.
autoUpdater.on('update-not-available', (ev,info) => {
// and load the index.html of the app.
if(!isPageLoaded){
loadPage();
}
});
if(isPageLoaded){
win.reload()
}
});

function loadPage(ref){
isPageLoaded = true;
win.loadFile('app/index.html');
}

function cleanUp(popupArray){
console.log(popupArray)
for(let popup of popupArray){
if(popup !== null && popup !== undefined){
popup.destroy();
}
}
}