Skip to content

fix(android, desktop): the chat list loads past its first page - #62

Merged
fighxy merged 3 commits into
mainfrom
claude/sweet-ramanujan-3q64b7
Nov 17, 2026
Merged

fighxy merged 3 commits into
mainfrom
claude/sweet-ramanujan-3q64b7

Conversation

@fighxy

@fighxy fighxy commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Проблема

На Android и ПК список чатов обрывался: дальше первой страницы его не прокрутить.

CoreChatRepository.refresh догружал весь список (loadAllChats: страницы CHATS_LIST после chatMarker из LOGIN) только пока в хранилище ядра не было ни одного чата. Но LOGIN сам кладёт в хранилище первые чаты, поэтому к первому обновлению оно уже не пустое, и всегда шёл loadChats(), то есть только первая страница.

Исправление

  • Весь список догружается один раз на аккаунт за запуск (needsFullList). Дальнейшие обновления спрашивают первую страницу, как раньше.
  • clear() при выходе забывает, что список был догружен.
  • Тесты: ChatListPagingTest.

Примечание

В ветке был и iOS-коммит бейджа при частичном прочтении, но вместе с откатом: он ждал ядро. Итог слияния — только maxly-shared. iOS-часть вместе с переводом core.lock — в #63.

Проверка

Локально не собиралось. На устройстве: аккаунт, у которого больше 50 чатов: после входа список листается до конца.

A read mark of this account from another device below the chat's last
message left the unread counter as it was until the next chat list sync:
the read event carried only the mark time. The core now recounts the
chat after the mark and passes it on (maxly-core IosEvent.chatUnread);
applyOwnRead takes that count when it is lower than the local one. A
mark at the last message still clears the badge.

Needs maxly-core with IosEvent.chatUnread (fighxy/maxly-core#4); core.lock
must move to that commit before this builds.
It needs maxly-core with IosEvent.chatUnread (fighxy/maxly-core#4), which is
not merged yet, so the iOS build would fail. Revert this revert once
core.lock points at a core with that field.

This reverts the previous commit.
CoreChatRepository.refresh loaded the whole chat list (loadAllChats, the
CHATS_LIST pages after LOGIN's chatMarker) only while the core store had
no chats. LOGIN itself puts the first chats into the store, so by the
first refresh the store was never empty and only the first page came:
on Android and desktop the chat list ended early and could not be
scrolled further.

The whole list now loads once per account and run (needsFullList), later
refreshes ask the first page as before; clear() forgets it.
@fighxy
fighxy force-pushed the claude/sweet-ramanujan-3q64b7 branch 2 times, most recently from 84365e3 to b05ec6d Compare November 17, 2026 03:01
@fighxy
fighxy merged commit 329709b into main Nov 17, 2026
@fighxy fighxy changed the title fix(android, desktop): the chat list loads past its first page fix: chat list loads past its first page; partial read lowers the iOS badge Nov 17, 2026
@fighxy fighxy changed the title fix: chat list loads past its first page; partial read lowers the iOS badge fix(android, desktop): the chat list loads past its first page Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant