From 7bcb595b18f27aaeefef7094ead893a7ffce6e13 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 27 Jan 2026 00:30:47 -0500 Subject: [PATCH] Update conversations.php --- conversations.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/conversations.php b/conversations.php index 8836a03..a0402ef 100644 --- a/conversations.php +++ b/conversations.php @@ -1948,6 +1948,20 @@ if (nearBottomNow && !this._userScrolling) this.scrollToBottom(); } + // If we received any delta messages, perform an immediate full fetch to sync any server-side batching + if (messages.length > 0) { + if (!this._fullLoadInProgress) { + try { + if (console && console.debug) console.debug('pollNewMessages: delta returned, triggering immediate full reload'); + await this.loadMessages(this.currentUserId, true, nearBottomNow && !this._userScrolling); + } catch (e) { + console.warn('Immediate full reload after delta failed', e); + } + } else { + if (console && console.debug) console.debug('Immediate full reload skipped because another full load is in progress'); + } + } + // update latest timestamp from the last message try { const last = messages[messages.length - 1];