Starting a download seems to break EventSources


#1

Electron: 1.4.3
OS: macOS: 10.12

Triggering a download in electron seems to close existing EventSources within the page. As soon as i click on a link that triggers a download dialog the EventSource contained in my page gets closed: readyState === EventSource.CLOSED and does not reconnect any longer. The same code works fine in a Chrome browser.

My debug logs show a did-fail-provisional-load event while triggering the download which might be related to closing the EventSource. But i would not consider that to be a fatal error and thus expect the EventSource to remain open/connected in case of a download https://html.spec.whatwg.org/multipage/comms.html#eventsource:

CLOSED (numeric value 2)
The connection is not open, and the user agent is not trying to reconnect. Either there was a fatal error or the close() method was invoked.

[2016-10-17 10:21:39.432] [INFO] [default] - will-navigate [ { preventDefault: [Function: preventDefault],
    sender: 
     WebContents {
       webContents: [Circular],
       history: [Object],
       currentIndex: 4,
       pendingIndex: -1,
       inPageIndex: 3,
       _events: [Object],
       _eventsCount: 24,
       _maxListeners: 0,
       browserWindowOptions: [Object] } },
  'http://127.0.0.1:9000/auftraege/7d77178b-65aa-4758-86ae-36e5c4fe314c/rueckfrage/35b8137d-1ffe-440d-8f15-661b6cf0a356' ]

[2016-10-17 10:21:39.437] [INFO] [default] - did-start-loading [ { preventDefault: [Function: preventDefault],
    sender: 
     WebContents {
       webContents: [Circular],
       history: [Object],
       currentIndex: 4,
       pendingIndex: -1,
       inPageIndex: 3,
       _events: [Object],
       _eventsCount: 24,
       _maxListeners: 0,
       browserWindowOptions: [Object] } } ]

[2016-10-17 10:21:39.540] [INFO] [default] - did-fail-provisional-load [ { preventDefault: [Function: preventDefault],
    sender: 
     WebContents {
       webContents: [Circular],
       history: [Object],
       currentIndex: 4,
       pendingIndex: -1,
       inPageIndex: 3,
       _events: [Object],
       _eventsCount: 24,
       _maxListeners: 0,
       browserWindowOptions: [Object] } },
  -3,
  'ERR_ABORTED',
  'http://127.0.0.1:9000/auftraege/7d77178b-65aa-4758-86ae-36e5c4fe314c/rueckfrage/35b8137d-1ffe-440d-8f15-661b6cf0a356',
  true ]

Please let me know i should file an issue on gitlab for this case.