mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-50002] catch and log exceptions from missed message listeners
This commit is contained in:
@@ -189,9 +189,16 @@ export default class WebSocketClient {
|
||||
console.log('long timeout, or server restart, or sequence number is not found.'); //eslint-disable-line no-console
|
||||
|
||||
this.missedEventCallback?.();
|
||||
this.missedMessageListeners.forEach((listener) => listener());
|
||||
|
||||
this.serverSequence = 0;
|
||||
|
||||
for (const listener of this.missedMessageListeners) {
|
||||
try {
|
||||
listener();
|
||||
} catch (e) {
|
||||
console.log(`missed message listener "${listener.name}" failed: ${e}`); // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
|
||||
this.serverSequence = 0;
|
||||
}
|
||||
|
||||
// If it's a fresh connection, we have to set the connectionId regardless.
|
||||
|
||||
Reference in New Issue
Block a user