BREAKING CHANGE(socketconnection): Stricter typings, smartserve hooks, connection fixes, and tag API change
This commit is contained in:
@@ -98,11 +98,18 @@ export class SmartsocketClient {
|
||||
}
|
||||
|
||||
private isReconnecting = false;
|
||||
private isConnecting = false;
|
||||
|
||||
/**
|
||||
* connect the client to the server
|
||||
*/
|
||||
public async connect() {
|
||||
// Prevent duplicate connection attempts
|
||||
if (this.isConnecting) {
|
||||
return;
|
||||
}
|
||||
this.isConnecting = true;
|
||||
|
||||
// Only reset retry counters on fresh connection (not during auto-reconnect)
|
||||
if (!this.isReconnecting) {
|
||||
this.currentRetryCount = 0;
|
||||
@@ -213,6 +220,7 @@ export class SmartsocketClient {
|
||||
await this.addTag(oldTagStore[tag]);
|
||||
}
|
||||
this.updateStatus('connected');
|
||||
this.isConnecting = false;
|
||||
done.resolve();
|
||||
break;
|
||||
|
||||
@@ -262,6 +270,7 @@ export class SmartsocketClient {
|
||||
return;
|
||||
}
|
||||
this.disconnectRunning = true;
|
||||
this.isConnecting = false;
|
||||
this.updateStatus('disconnecting');
|
||||
this.tagStoreSubscription?.unsubscribe();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user