BREAKING CHANGE(socketconnection): Stricter typings, smartserve hooks, connection fixes, and tag API change

This commit is contained in:
2025-12-04 07:59:44 +00:00
parent 5b21955e04
commit 0499db71b8
12 changed files with 1039 additions and 2864 deletions

View File

@@ -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();