nextcloud / nextcloud/notes-android

Slow search in long notes

Open
#1,729 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Performance 🚀
Dominant language
Java
Stars
1.1k
Forks
168
Avg merge
1d 17h
Merged PRs (30d)
31

Description

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug
When searching for a term in a very long note, the app doesn't wait for the user to finish typing but starts searching instantly which results in finding matches for the first letter and then recognizing that the user typed a much longer term and starts searching again.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new note, add a novel of text to it and save by going back to the overview.
  2. Reenter the note and type a word in the search bar.
  3. First, the app will only show one letter in the search bar, but you can keep typing on the keyboard. Do so.
  4. The first search iteration will highlight all findings for the first letter of the word and then starts over instantly again for the full word.

Expected behavior
There should be a search delay of one second after the user stopped typing before the search is triggered. This will result in cutting down the search time by half in long notes.

Screenshots
Search results after the first iteration while the second iteration is running and will produce findings for the entire word soon

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 4.0.0 RC1
  • F-Droid or Play Store: FDroid
  • Android-Version: 11
  • Device: Sony Xperia

Server

  • Nextcloud version: 26.0.0
  • Nextcloud Notes version (server app): 4.7.2

Stacktrace

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with a very long note and inspect the note search bar's input-handling entry point. The fix is done when searching waits one second after typing stops and does not run intermediate searches for each character.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.