Метод syncUnreadTree
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesim/lib/V2/Chat/Tree/ChatTreeAttachmentManager.php
Исходный код
Сигнатура метода
protected function syncUnreadTree(GroupChat $chat, int $parentChatId): void
Возвращает:
void
Описание
Keeps the unread-counters tree denormalization (b_im_message_unread.PARENT_ID) in step with the chat tree and drops the affected users' counters cache. Both run in one terminate-phase job — off the request path, and ordered so the cache is cleared only AFTER the denormalization; otherwise the next recompute would read the stale PARENT_ID and re-cache it for the whole TTL. The client-facing pulls are not part of this deferred job: UpdateService emits recentUpdate (the new parent context) right before chatUpdate, so the client applies the context first and re-renders on chatUpdate.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$chat
|
GroupChat
|
-
|
-
|
$parentChatId
|
int
|
-
|
-
|