mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 01:48:15 +03:00
webmail: reconnect automatically in more cases
Before, we would only reconnect the SSE connection when the previous one lasted 10 minutes. For some reason, firefox disconnects SSE connections when there is any network change. Running the docker integration tests changes the network a few time in quick succession, prevent further automatic reconnects. This changes the "stop reconnection automatically" period from 10 minutes to 5 seconds.
This commit is contained in:
parent
aba0061073
commit
5dcf674761
@ -7005,7 +7005,6 @@ const init = async () => {
|
||||
connectionElem.classList.toggle('loading', true);
|
||||
dom._kids(connectionElem);
|
||||
connectionElem.classList.toggle('loading', false);
|
||||
// We'll clear noreconnect when we've held a connection for 10 mins.
|
||||
noreconnect = isreconnect;
|
||||
connecting = true;
|
||||
let token;
|
||||
@ -7194,10 +7193,13 @@ const init = async () => {
|
||||
}
|
||||
dom._kids(queryactivityElem, 'loading...');
|
||||
msglistscrollElem.appendChild(listloadingElem);
|
||||
// We'll clear noreconnect when we've held a connection for 5 seconds. Firefox
|
||||
// disconnects often, on any network change including with docker container starts,
|
||||
// such as for integration tests.
|
||||
noreconnectTimer = setTimeout(() => {
|
||||
noreconnect = false;
|
||||
noreconnectTimer = 0;
|
||||
}, 10 * 60 * 1000);
|
||||
}, 5 * 1000);
|
||||
});
|
||||
eventSource.addEventListener('viewErr', async (e) => {
|
||||
const viewErr = checkParse(() => api.parser.EventViewErr(JSON.parse(e.data)));
|
||||
|
@ -7271,7 +7271,6 @@ const init = async () => {
|
||||
dom._kids(connectionElem)
|
||||
connectionElem.classList.toggle('loading', false)
|
||||
|
||||
// We'll clear noreconnect when we've held a connection for 10 mins.
|
||||
noreconnect = isreconnect
|
||||
connecting = true
|
||||
|
||||
@ -7473,10 +7472,13 @@ const init = async () => {
|
||||
dom._kids(queryactivityElem, 'loading...')
|
||||
msglistscrollElem.appendChild(listloadingElem)
|
||||
|
||||
// We'll clear noreconnect when we've held a connection for 5 seconds. Firefox
|
||||
// disconnects often, on any network change including with docker container starts,
|
||||
// such as for integration tests.
|
||||
noreconnectTimer = setTimeout(() => {
|
||||
noreconnect = false
|
||||
noreconnectTimer = 0
|
||||
}, 10*60*1000)
|
||||
}, 5*1000)
|
||||
})
|
||||
eventSource.addEventListener('viewErr', async (e: MessageEvent) => {
|
||||
const viewErr = checkParse(() => api.parser.EventViewErr(JSON.parse(e.data)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user