@pmate/chat-sdk 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/runtime/activity.js +4 -1
- package/lib/runtime/chatClient.js +5 -2
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/runtime/activity.js
CHANGED
|
@@ -114,7 +114,10 @@ export class ChatActivityPublisher {
|
|
|
114
114
|
await this.send({ ...current, seq: this.seq++ });
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
|
-
|
|
117
|
+
try {
|
|
118
|
+
this.onError(error);
|
|
119
|
+
}
|
|
120
|
+
catch { /* Error reporting must not break progress cleanup. */ }
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
}
|
|
@@ -42,8 +42,11 @@ export class ChatClient {
|
|
|
42
42
|
this.client.on(ChatRealtimeEvents.Message, (message) => {
|
|
43
43
|
this.handleIncoming(message);
|
|
44
44
|
});
|
|
45
|
-
this.client.on(ChatRealtimeEvents.Connected, (connected) => { if (!connected)
|
|
46
|
-
this.
|
|
45
|
+
this.client.on(ChatRealtimeEvents.Connected, (connected) => { if (!connected) {
|
|
46
|
+
for (const publisher of this.publishers)
|
|
47
|
+
void publisher.stop();
|
|
48
|
+
this.activities.clear();
|
|
49
|
+
} });
|
|
47
50
|
await this.waitUntilConnected();
|
|
48
51
|
await this.sendAuth();
|
|
49
52
|
return this;
|