Skip to content

Fix to show search results immediately - #7032

Merged
mahibi merged 5 commits into
masterfrom
fixToShowSearchResultsImmediately
Nov 12, 2026
Merged

mahibi merged 5 commits into
masterfrom
fixToShowSearchResultsImmediately

Conversation

@mahibi

@mahibi mahibi commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • Searching in the conversation list showed nothing until the server had answered, even for conversations already stored on the phone.
  • On top of that, a 300 ms typing pause ran before any search started, so the list stayed empty after the first letter.

Regression history

  • Until early December 2025, local conversations were filtered immediately.
  • 4be64e3 (2025-12-09) made local filtering wait for the users and open-conversations requests (awaitAll).
  • 023588b (2025-12-17) moved search into combine(rooms, openConversations, contacts, messages). combine waits for every source, so everything waited for the slowest server request.

Changes, one line per commit

  1. cc40c6f10: the server requests start as "pending", so local results show at once and server results are added as they arrive. Loading lasts until all requests have answered. A failed request counts as an empty answer.
  2. feb8af53c: changing the query cancels the old search; "load more" messages survive later rebuilds; no stuck spinner when going back to the previous query.
  3. 4a74ed489: a failed "load more" no longer crashes; double-tapping "load more" no longer loads the same page twice (that crashed on duplicate list keys); "load more" is cancelled when the query changes; a rotation no longer restarts a running search.
  4. d404f0cb6: a failed or stale "load more" entry is removed or ignored, so the old query's messages can't load into a new search.
  5. 53e75d590: only the server requests wait for the 300 ms typing pause; local results show on the next frame.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@mahibi mahibi added this to the 26.0.0 milestone Nov 11, 2026
@mahibi
mahibi requested a review from rapterjet2004 November 11, 2026 20:42
@mahibi mahibi self-assigned this Nov 11, 2026
@mahibi mahibi added the 3. to review Waiting for reviews label Nov 11, 2026

@AndyScherzinger AndyScherzinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

… the server

The search combined the stored conversations with the open conversations,
users and messages fetched from the server. combine only emits once every
source has emitted, so the matching local conversations were only shown
after the slowest server request had answered.

The server requests now start as pending, so local matches are shown at
once and the server results are added as they arrive. The search counts
as loading until every server request has answered, so "no results" is
not shown too early. A failed request counts as answered with no results
instead of ending the whole search.

The regression was introduced in 4be64e3, which made local filtering
wait for the users and open conversations, and kept by 023588b, which
moved the search into combine.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Since the local search results are shown before the server has answered,
the search results are rebuilt with every server response. This made
some existing problems easier to hit:

- Messages loaded with "load more" were replaced by the first page again
  when a later server response arrived.
- The search of the previous query kept running until the new search
  started after the debounce. Its responses replaced the results and
  ended the loading state while the new query was being typed.
- Returning to the previous query before the debounce ended skipped the
  search and left the loading state on.

The running search is now canceled as soon as the query changes, and the
messages loaded with "load more" are kept when the results are rebuilt.
The word pattern is built once per search instead of for every response.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
- A failed "load more" request was not caught and crashed the app. The
  error is now logged and the shown messages are kept.
- Tapping "load more" again while it was loading requested the same page
  twice, which listed messages twice and crashed the list on the
  duplicate keys. Further taps are now ignored until it has finished.
- A "load more" of the previous query kept running after the query
  changed and could mix its messages into the new search. It is now
  canceled together with the search.
- Repeating the same query, for example after a rotation, started the
  search again when no results were shown yet. It is now skipped while
  the search of that query is still running.

The new test file uses the SPDX copyright line for new files.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
- After a failed "load more" request, the message search can't continue,
  but the "load more" entry stayed and did nothing when tapped. It is now
  removed, also when later server responses rebuild the results.
- A "load more" entry still shown from the previous query could load
  more messages of that query into the new search, before the new search
  had reset the message search. "Load more" now only runs once the first
  page of messages of the current search has arrived.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
… pause

The search only started 300 ms after the last keystroke, so the result
list stayed empty for that time, although the stored conversations can
be filtered at once. The pause is only needed to avoid a server request
per keystroke.

The search now starts at every keystroke and only the server requests
wait for the pause. Changing the query cancels the search while it
waits, so typing quickly still sends the server requests for the last
query only.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi
mahibi force-pushed the fixToShowSearchResultsImmediately branch from 9474557 to 9ace5be Compare November 12, 2026 10:48
@github-actions

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 9ace5be
Version 7032
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@github-actions

Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings1717
Errors00

SpotBugs

CategoryBaseNew
Bad practice77
Correctness88
Dodgy code4040
Internationalization33
Malicious code vulnerability33
Performance77
Security1111
Total7979

@mahibi
mahibi merged commit b7f197b into master Nov 12, 2026
20 checks passed
@mahibi
mahibi deleted the fixToShowSearchResultsImmediately branch November 12, 2026 13:41
@mahibi

mahibi commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-25.1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants