Repository navigation
[stable-25.1.x] fix(chat): keep the reply count of a thread up to date - #7059
Merged
Merged
Conversation
The "x replies" label of a thread root is read from the cached root message, which only changed when the root message itself was fetched again. The server sends the current reply count of the thread with every message of the thread, over the chat API and the chat relay alike, but it was only stored on the reply itself. Replies fetched by the background prefetch or while the chat was open therefore never reached the label. When messages are stored, copy the reply count of the newest message of each thread onto the cached root message. Every sync path stores messages through upsertChatMessagesAndDeleteTemp, so HTTP polling, signaling and the background prefetch are all covered. Counts that are already stale in the cache are not touched by that, as no new message of the thread may arrive. Opening the main chat therefore also fetches the recently active threads of the conversation and writes their reply counts into the cached roots, the way the web client takes them from its thread list. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The reply count of a thread is taken from the server, so the local count of replies by parent message is no longer used anywhere. Remove the query and its repository and preview wrappers. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Inside a thread, the "x replies" subtitle of the toolbar was taken from the thread endpoint, which is only asked once when the thread is opened. Replies that arrived while the thread was open never reached it. The cached root message of the thread already follows the chat, as every stored thread message carries the thread's current reply count over to it. Observe that root and show its count in the toolbar. The higher of the root's count and the endpoint's count is shown, as a thread's reply count only grows and the root may not be cached yet. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de> Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each stored batch of messages wrote the count of its newest thread message onto the thread root, so a response that took longer than a relayed reply could lower the count again until the next reply. A thread's reply count only grows on the server, so only raise the stored count, and write all counts through one path. Inside a thread, the reply count in the toolbar was read from the cached root message only, so it did not follow the chat when the root was not cached, e.g. for a thread opened from a notification whose root is older than the loaded messages. Read the highest count of all cached messages of the thread instead, as every message of a thread carries the thread's count. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de> Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger
force-pushed
the
backport/7034/stable-25.1.x
branch
from
November 17, 2026 19:27
9cdb800 to
b01ab05
Compare
Contributor
📱 QA build
The QA build installs alongside a released Nextcloud app, so you can keep Downloading the file requires a GitHub account, so open this link on the |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #7034
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.