git » sdk » commit d410689

Need to keep saving changes as we send stanzas

author Stephen Paul Weber
2026-03-16 17:52:38 UTC
committer Stephen Paul Weber
2026-03-16 17:52:38 UTC
parent 4a615b24545a15b67974251c02a11a0963def64e

Need to keep saving changes as we send stanzas

even if disconnected

borogove/streams/XmppJsStream.hx +2 -2

diff --git a/borogove/streams/XmppJsStream.hx b/borogove/streams/XmppJsStream.hx
index 8650fa6..72526d7 100644
--- a/borogove/streams/XmppJsStream.hx
+++ b/borogove/streams/XmppJsStream.hx
@@ -431,8 +431,8 @@ class XmppJsStream extends GenericStream {
 	}
 
 	private function triggerSMupdate() {
-		if ((lastSMState == null || pending.length < 1) && (client == null || !client.streamManagement?.enabled || !emitSMupdates)) return;
-		if (client?.streamManagement?.enabled) {
+		if (lastSMState == null && (client == null || !client.streamManagement?.enabled || !emitSMupdates)) return;
+		if (client?.streamManagement?.enabled || (client?.streamManagement?.outbound_q?.length ?? 0) > 0) {
 			lastSMState = {
 				id: client.streamManagement.id,
 				outbound: client.streamManagement.outbound,