Socket closing without prompt
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- networking
Direzione di ricerca
Inizia esaminando le socket connect options e il callback serverFromRequest.subscription.onUnsubscribe mostrati nel report, concentrandoti sulle condizioni che chiudono o annullano la sottoscrizione di un socket. Non sono indicati file o test specifici; il lavoro sarà concluso quando saranno identificati i casi rilevanti di annullamento della sottoscrizione e sarà determinato se le impostazioni reconnect, timeout o heartbeat spiegano il comportamento in produzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): yes
Context
- node version: 16.0
- module version: 12.0.4
- environment (e.g. node, browser, native): browser (and node)
- used with (e.g. hapi application, another framework, standalone, ...): hapi application
- any other relevant information:
How can we help?
Some users in production are being unsubscribe from the socket without us really knowing why. Their internet access is supposedly stable...
I feel I am missing some cases of automatic unsubscribe so I must ask : what are the different cases where the socket might trigger the onUnsubscribe function ?
Here are the different declarations:
/**CLIENT CODE connection **/
return this.socketClient.connect({
reconnect: true, //whether the client should try to reconnect
delay: 2000, //time in milliseconds to wait between each reconnection attempt, cumulative
maxDelay: 15000, //the maximum delay time in milliseconds between reconnections
retries: 10 //number of reconnection attempts
})
/** SERVER REGISTER **/
await server.register(
{
plugin: Nes,
options: {
heartbeat: {
interval: 15000,
timeout: 5000
},
auth: false
}
},
{
routes: process.env.ROOT_PATH ? {
prefix: ROOT_PATH
} : {}
}
);
this.serverFromRequest.subscription(this.subscribingPath , {
onSubscribe: (socket, path, params)=>{
/** SOME CODE that has nothing to do with network **/
//Managing page reloading by clearing a timeout
if (this.onUnsubscribeTimeout) {clearTimeout(this.onUnsubscribeTimeout)}
},
onUnsubscribe: (socket, path, params)=>{
/** SOME CODE that has nothing to do with network **/
const unloadTimeout = 15000;
this.onUnsubscribeTimeout = setTimeout(()=>{
/** SOME CODE saying what should happen when socket is closed ( basically send message to client saying Chat is closed)
}, unloadTimeout)
}
})
What do you think ?
Is the fact maxDelay very closed to unloadTimeout could explain the issue ?
Are my connect options not precise enough or too low ? Or the heartbeat maybe ?
What would be good production values according to your knowledge ?
Regards and thank you for nes !
- Lingua principale
- JavaScript
- Stelle
- 502
- Fork
- 85
- Merge medio
- 16g 16h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hapijs/nes
-
Listener does not correctly handle optional & wildcard routes.Forse di nuovo libera @damusix l’ha presa 212 giorni fa e non c’è nessuna pull request aperta. Apertabug
-
support
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Polling option fallbackApertasupport
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
SACGF/variantgrid#2341 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)Forse già presa @Jxxunnn l’ha presa oggi. ApertaBrowser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
getsentry/sentry-javascript#25497 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[External Plugin]: rostrumApertaexternal-plugin needs-review:HIGH ready-for-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
github/awesome-copilot#5162 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno