Mark message prefetch requests and let the server turn preloading off - #6763
Draft
AndyScherzinger wants to merge 2 commits into
Draft
AndyScherzinger wants to merge 2 commits into
AndyScherzinger wants to merge 2 commits into
Conversation
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 23, 2026 14:21
1c54f14 to
d1cf526
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 23, 2026 14:21
251d2a5 to
657f4d1
Compare
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 23, 2026 15:12
d1cf526 to
61d24d9
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 23, 2026 15:12
657f4d1 to
7e7827c
Compare
This was referenced Sep 23, 2026
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 24, 2026 06:09
61d24d9 to
6cbc0f4
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 24, 2026 06:09
7e7827c to
7b03e5c
Compare
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 24, 2026 08:29
6cbc0f4 to
e314853
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 24, 2026 08:29
7b03e5c to
6ac16cc
Compare
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 24, 2026 14:43
e314853 to
79bbdf7
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 24, 2026 14:43
6ac16cc to
921f65a
Compare
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 24, 2026 16:33
79bbdf7 to
d6f1aeb
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 24, 2026 16:33
921f65a to
adc4b8c
Compare
The client fetches a room's messages before the user asks for them, from a push notification and after a conversation list sync, and on the wire those requests are indistinguishable from the ones a user waiting on a chat screen is making. A server operator looking at request volume cannot tell what was speculative and what someone was waiting for. Send prefetch=1 on the chat requests the catch-up makes. The server ignores the parameter - the response is byte for byte the one it sends without it - so this only makes the traffic legible in an access log, where a query parameter needs no configuration to be recorded. The flag travels the same route as markNotificationsAsRead, which already separates these two cases, and defaults to false: the helpers that build the request are shared with the chat the user has open, and labelling those as prefetched would invert the very distinction this is for. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Preloading a conversation's messages before the user opens it spends the server's bandwidth on traffic nobody asked for yet. An operator who would rather not pay that can now say so: the mobile-preload-chat setting turns it off for mobile clients, and the server reports it in the chat config capabilities. Skip the catch-up when the server reports it as false. Anything else preloads - a server that reports it true, and a server too old to know the setting at all, which cannot mean the operator declined something they were never offered. Both entry points check it. The conversation list skips the whole catch-up rather than asking room by room, and the syncer checks it too, because push notifications reach it without passing the list. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger
force-pushed
the
feat/noid/conversation-list-foreground-sync
branch
from
September 24, 2026 16:59
d6f1aeb to
f7eb4c3
Compare
AndyScherzinger
force-pushed
the
feat/noid/mark-prefetch-requests
branch
from
September 24, 2026 16:59
adc4b8c to
9877751
Compare
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.
The client fetches a conversation's messages before the user asks for them — after a push notification, and after a conversation list sync. On the wire those requests look exactly like the ones a user staring at a chat screen is waiting for, and the server has no way to say it would rather the client didn't make them at all.
Two commits, each answering one half of that.
prefetch=1on the requests the catch-up makesA query parameter rather than a header, so it lands in a standard access log without any server configuration. Verified against a live server: the response is byte for byte the one sent without it, so the parameter is inert and purely descriptive.
The flag travels the same route as
markNotificationsAsRead, which already separates these two cases, and defaults to false. The helpers that build the request are shared with the chat the user has open (OfflineFirstChatRepositorycallsbuildFieldMaptoo), so a flag set any higher up would have labelled the messages someone is actively reading as prefetched — inverting the distinction this exists to draw. There is a test for exactly that.The
mobile-preload-chatcapabilityImplements the client side of spreed#19509. Preloading is skipped only when the server reports the setting as
false. A server that reportstrue, one that omits it, and one too old to know it at all all preload — an operator cannot have declined something they were never offered.Checked at both entry points, mirroring how
chat-keep-notificationsis already handled: the conversation list skips the whole catch-up rather than asking room by room, and the syncer checks it too, because push notifications reach it without passing the list.Scope
Only message preloading. The conversation list sync is not gated: the capability is about chat messages, and an operator turning message preloading off has not asked for unread counts to go stale.
🚧 TODO
falsepath against a server that reports the capability — the test instance predates spreed#19509, so only the absent case could be exercised live🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)