From 103c3422a5019a654e1a2d77ae7b7985390a0696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=9D=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Tue, 13 Jan 2026 09:42:57 +0300 Subject: [PATCH] =?UTF-8?q?debug:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20lastReadMessageId=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=B8=D0=B0=D0=B3=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=81=D0=BA=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Логируем сырое значение из data-last-read-message-id - Логируем решение загрузки (around vs latest) - Поможет понять почему скролит в низ вместо последнего прочитанного --- backend/static/js/loaders/messageLoaderV2.js | 7 +++++++ backend/static/js/pages/chatDetail.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/backend/static/js/loaders/messageLoaderV2.js b/backend/static/js/loaders/messageLoaderV2.js index 1ca7d6bf..14e7bee7 100644 --- a/backend/static/js/loaders/messageLoaderV2.js +++ b/backend/static/js/loaders/messageLoaderV2.js @@ -102,6 +102,13 @@ export class MessageLoaderV2 { try { const { aroundMessageId, limit = this.config.INITIAL_LIMIT } = options; + console.log('[MessageLoaderV2] 🔍 Load decision:', { + aroundMessageId, + type: typeof aroundMessageId, + isPositive: aroundMessageId > 0, + willLoadAround: !!(aroundMessageId && aroundMessageId > 0) + }); + let result; if (aroundMessageId && aroundMessageId > 0) { result = await this._loadAround(chatId, aroundMessageId, limit, requestKey); diff --git a/backend/static/js/pages/chatDetail.js b/backend/static/js/pages/chatDetail.js index 8ff0dfa8..30cbc62e 100644 --- a/backend/static/js/pages/chatDetail.js +++ b/backend/static/js/pages/chatDetail.js @@ -71,6 +71,12 @@ function initWhenReady() { lastReadMessageId: appContainer.dataset.lastReadMessageId ? Number(appContainer.dataset.lastReadMessageId) : null }; + console.log('[ChatDetail] 🔍 lastReadMessageId from HTML:', { + rawValue: appContainer.dataset.lastReadMessageId, + parsedValue: config.lastReadMessageId, + type: typeof config.lastReadMessageId + }); + // Читаем дополнительные URL из chatScroll (для рендеринга сообщений) const chatScroll = document.getElementById('chatScroll'); if (chatScroll) {