Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Search - Green Circular Loading Indicator keeps loading after results appear #41787

Closed
2 of 6 tasks
lanitochka17 opened this issue May 7, 2024 · 10 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented May 7, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.71-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #39865

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Click on FAB > Start a chat
  3. Search for a contact inside the search input field

Expected Result:

The Green Circular Loading indicator stops loading after search results appear

Actual Result:

The Green Circular Loading indicator keeps on loading even after search results appear and are done

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6473957_1715099159868.bandicam_2024-05-07_19-22-13-086.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f38e992db5566a4a
  • Upwork Job ID: 1787956238083543040
  • Last Price Increase: 2024-05-07
Issue OwnerCurrent Issue Owner: @Ollyws
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@lschurr FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label May 7, 2024
@melvin-bot melvin-bot bot changed the title Search - Green Circular Loading Indicator keeps loading after results appear [$250] Search - Green Circular Loading Indicator keeps loading after results appear May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01f38e992db5566a4a

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

@brunovjk
Copy link
Contributor

brunovjk commented May 7, 2024

I couldn't reproduce it. However, there is an annoying delay when the search is completed (OptionsList) and the green indicator disappears (searchInServer).
I didn't have this issue when I was testing the PR. I believe this has to do with the server's response, since we depend on it to disappear with the indicator:

App/src/libs/actions/Report.ts

Lines 3540 to 3570 in 9fe4b15

function searchForReports(searchInput: string, policyID?: string) {
// We do not try to make this request while offline because it sets a loading indicator optimistically
if (isNetworkOffline) {
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, false);
return;
}
const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS,
value: false,
},
];
const failureData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS,
value: false,
},
];
const searchForRoomToMentionParams: SearchForRoomsToMentionParams = {query: searchInput, policyID: policyID ?? ''};
const searchForReportsParams: SearchForReportsParams = {searchInput};
API.read(policyID ? READ_COMMANDS.SEARCH_FOR_ROOMS_TO_MENTION : READ_COMMANDS.SEARCH_FOR_REPORTS, policyID ? searchForRoomToMentionParams : searchForReportsParams, {
successData,
failureData,
});
}
Anyway I made a proposal.

@brunovjk
Copy link
Contributor

brunovjk commented May 7, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

There is an annoying delay when the search is completed (getFilteredOptions) and the green indicator disappears (searchInServer) when we search for members.

What is the root cause of that problem?

The search and green circular behavior are not aligned. One depends on getFilteredOptions and another on searchInServer.
So, what I think is happening is that the response from option list comes first and only then do we have the response from searchInServer, creating this unnecessary delay.

What changes do you think we should make in order to solve the problem?

Align the behavior of the isLoadingNewOptions indicator directly with the member (option) list process, eliminating the dependency on the server response (ONYXKEYS.IS_SEARCHING_FOR_REPORTS) for controlling the indicator.

  1. Introduce a local state variable, such as isFetchingOptions, to track the status of the search process.
  2. Set isFetchingOptions to true when the fetch search + member (option) list process starts and to false when it completes.

Note: We need to do this on all pages that use this search for member flow.

What alternative solutions did you explore? (Optional)

N/A

@Ollyws
Copy link
Contributor

Ollyws commented May 10, 2024

I can't reproduce this, but as @brunovjk mentions there is a bit of a delay after the search results show up but I'm not sure wether that's worth fixing.

Copy link

melvin-bot bot commented May 13, 2024

@Ollyws, @lschurr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
@lschurr
Copy link
Contributor

lschurr commented May 13, 2024

I think we'll close since the original issue isn't happening any longer and the new bug seems small.

@lschurr lschurr closed this as completed May 13, 2024
@melvin-bot melvin-bot bot removed the Overdue label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants