mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.25k stars 1.36k forks source link

Only 60 or less results shown when using searching. #7725

Closed eli-yip closed 10 months ago

eli-yip commented 10 months ago

Summary

When I try to use search feature on mobile app, I can only get about 60 result, while on desktop it can be about 200 or more.

Environment Information

Steps to reproduce

Tap search button, and try to search message from someone or anything else that will have results more than 60, the mobile app will only show latest 60 results.

Expected behavior

Show all the results, or when I scroll down, it will refresh and get more results(like mattermost web app).

Observed behavior (that appears unintentional)

Only 60 max results.

Possible fixes

Your code lack of requesting for more data when scrolling to the end of page. Sorry I am not familiar about react native, but I can guess what is happening behind the bug.

amyblais commented 10 months ago

Opened https://mattermost.atlassian.net/browse/MM-56390.

amyblais commented 10 months ago

Closing as a Help Wanted issue was opened for this.

cyberjam commented 10 months ago

@eli-yip Do you have a screenshot for reproduction? When I tried to reproduce it, I got 100 results.

image
eli-yip commented 10 months ago

@eli-yip Do you have a screenshot for reproduction? When I tried to reproduce it, I got 100 results. image

Yes, screenshot from mobile, only 57 (below 60):

IMG_4052

And screenshot from web, 100+:

2024-01-14-qnRHL4vc000168

FYI:

  1. Message is Chinese simplified, client language is eng/ch. I guess you are using korean, so maybe cjk doesn't matter.
  2. I Use bleve as search engine. Though I think bleve has nothing to do with my problem, as I can see more results loading when I scroll down to the end of search result pannel on web while I see nothing on mobile.

Thank you for replying, I'm looking forward to bug fixes.

cyberjam commented 9 months ago

Hi @eli-yip. yes, I'm using korean. This issue is not related to CJK or search engine. The cause was that pagination had not been implemented. ref code Although it's a temporary solution, making the following changes will allow displaying up to 1000 results.

searchPosts(serverUrl, newSearchTeamId, {...searchParams, per_page:1000}),
searchFiles(serverUrl, newSearchTeamId, {...searchParams, per_page:1000}),

I'm busy with another task, so implementing for this issue is challenging for me. I hope someone else pick up this issue.

Have a nice weekend!