Repository navigation
perf(chat): prefetch and cache link previews, load older media earlier - #7043
Open
AndyScherzinger wants to merge 5 commits into
Open
AndyScherzinger wants to merge 5 commits into
AndyScherzinger wants to merge 5 commits into
Conversation
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 |
AndyScherzinger
force-pushed
the
perf/link-preview-cache-and-media-viewer-paging
branch
from
November 16, 2026 07:13
9225803 to
67caebf
Compare
AndyScherzinger
marked this pull request as ready for review
November 16, 2026 17:58
AndyScherzinger
force-pushed
the
perf/link-preview-cache-and-media-viewer-paging
branch
3 times, most recently
from
November 22, 2026 10:09
0452433 to
d341162
Compare
Contributor
The thumbnail of a link preview card was described with the format string "%1$s sent an image." without its argument, so screen readers read the placeholder out loud. The image only illustrates the card, whose title, description and link are read out already, so it no longer has a description of its own. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A link message requested its preview every time its bubble entered the composition again, e.g. when scrolling it out of view and back. The HTTP cache answered repeated requests for an hour, but every request still read and parsed the response again, and bubbles that asked for the same URL at the same time each sent a request of their own. Resolve link previews through a cache in the chat view model: each URL is requested once, concurrent calls share the request, a URL without a preview is remembered as such, and a failed request is made again by the next call, also when nobody waited for it. The cache keeps the 100 most recently used URLs. iOS keeps the resolved reference data on the message the same way. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Older media are added in front of the list. The pager identified its pages by position, so the view model shifted the position afterwards with scrollToPage. That shift was dropped while the user was dragging, leaving them on an item further back while the title, share and save referred to another one. Otherwise the wrong item was drawn for a frame and the shown page was rebuilt, losing its zoom. Identify the pages by their message id, so the pager keeps the shown item in place when items are added in front, and remove the shift. As page keys must be unique, duplicate items in the seed are dropped and the view model is seeded only once, so a recreated activity cannot start a second load of the same older media. The shown page is reported at the end of every scroll, also when its position did not change because items were added during the scroll. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A failed request for older media was handled like the end of the history, so older media could not be reached again until the viewer was reopened, even after the connection was back. Keep loading older media possible after a failure, so the next item shown near the oldest one requests them again. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The media viewer only loaded older media once the second oldest item was shown, so swiping back stalled at the edge until the request was answered. Load older media as soon as an item within the ten oldest is shown. The existing guards still allow only one request at a time. iOS starts loading more items ten items before the end of its media list. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger
force-pushed
the
perf/link-preview-cache-and-media-viewer-paging
branch
from
November 23, 2026 07:23
d341162 to
327f20b
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.
Closes the prefetching gaps to the iOS app found when comparing what each client fetches while showing a chat. Attachments were already at parity (server thumbnails with blurhash placeholders, no server previews in classified conversations, GIFs, media viewer downloads), so the remaining gaps were link previews and media viewer paging.
Both apps use the same
references/resolveendpoint, so no API changes are involved. Link previews in classified conversations behave as before; the prefetch does not add requests for content that was not already requested on display.🖼️ Screenshots
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)