Open orschiro opened 7 years ago
Can you go to chrome://extensions/
, inspect the background page of the extension and show the log?
You shouldn't have to manually restart the socket, the extension aims to automatically detect that the socket is down and attempts to re-establish the connection with exponential back-off (capped to at least once per ten minutes).
Thanks, Rob!
Does this help at all?
The part of the log that you have shown looks healthy: The connection seems to be closed and re-opened when needed.
Next time you encounter that the notification count is off (and the socket is down), can you look at the bottom of the log of the background console and show it here?
Yes, I will. Thanks!
Dear @Rob--W,
It happened again but this time I don't see any error log.
That is really odd. At the very least I expect either "Opened WebSocket and subscribed to method [numbers]-topbar" or "Closed WebSocket" or "WebSocket failed".
Could you follow the following steps:
(instead of a screenshot you can also record a video).
Thanks for your instructions!
I hope this is what you were looking for:
I left one important detail in my request, please post the result when you observe that the socket is unexpectedly down. I am expecting heartbeat messages every few minutes; If the socket is somehow closed permanently then the received/sent messages, timestamps and logging messages will help with discovering why the socket unexpectedly closes.
I see. So at best, I should send you the screenshot immediately after it shut down, correct?
Well, that's very hard. I can never be sure when it closes the connection. I usually don't get new messages for days, So sometimes, I don't even check it for a long time and don't expect anything to appear.
I see. So at best, I should send you the screenshot immediately after it shut down, correct?
Any time after shutdown is OK, because once stuck in the shutdown state, there isn't going to be any other network activity. At the very least I want to see the console messages; the network tab is a nice-to-have.
OK!
I will provide you with that.
Actually, thinking about it, what would help debugging:
Can the icon show "0" if there are no new messages? And as soon as the socket stops it would show nothing anymore, correct?
Not even 0.
On Tue, Feb 7, 2017 at 11:36 AM Rob Wu notifications@github.com wrote:
I see. So at best, I should send you the screenshot immediately after it shut down, correct?
Any time after shutdown is OK, because once stuck in the shutdown state, there isn't going to be any other network activity. At the very least I want to see the console messages; the network tab is a nice-to-have.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Rob--W/stackexchange-notifications/issues/28#issuecomment-277960988, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKbw5THoHKnIzEMB9j6jFo-mkKeB4-gks5raEk0gaJpZM4L2CyM .
When the socket is down, the message count is whatever the last count was. This can be 0, but also 1 or 10. The socket going down is handled gracefully, the extension reconnects and upon success fetches the socket count via the StackExchange API if you have authenticated with oAuth at the options page.
If you want to be notified of socket events, run the following snippet in the background script's console,
eventEmitter.on('socket', function(status) {
console.log('Socket status = ' + status);
setTimeout(function() {
alert('Socket status ' + status);
}); // Non-blocking.
});
OK, done!
And now I just have to wait?
Dear @Rob--W,
Sometimes the extension simply stops and I don't know why, nor do I get any notification about it.
I then assume that I don't have any new notifications although I do.
For these cases, could the icon display an exclamation mark instead of the number of unread notifications to indicate and tell me that I need to take action?
Yours,
Robert