git » sdk » commit f8153cf

Clear sync on reconnect

author Eric Roberts
2026-10-06 20:47:08 UTC
committer Stephen Paul Weber
2026-10-21 15:39:58 UTC
parent 89926f993824bd896d7588e1eda3c96504b70089

Clear sync on reconnect

We are connecting and not resuming, so it's a fresh connection.

Any stanzas in flight on the previous session may or may not be received
by this session.

So we want to clear our existing syncs and let new ones start.

borogove/Chat.hx +1 -0
borogove/Client.hx +3 -0

diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 59c8041..2346ef1 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -1516,6 +1516,7 @@ class Channel extends Chat {
 	private var inSync = false;
 	@:allow(borogove)
 	private var joinFailed = null;
+	@:allow(borogove)
 	private var sync: Null<MessageSync> = null;
 	private var forceLive = false;
 	@:allow(borogove)
diff --git a/borogove/Client.hx b/borogove/Client.hx
index 670bf3c..dfe1460 100644
--- a/borogove/Client.hx
+++ b/borogove/Client.hx
@@ -1128,6 +1128,9 @@ class Client extends EventEmitter {
 		}
 
 		channelPinger.clear();
+		for (channel in getChannels()) {
+			channel.sync = null;
+		}
 
 		// We don't know what any presences are
 		persistence.clearMemberPresence(accountId(), null);