Skip to content

[$250] Search - Search section loads infinitely when opened after logging in #53285

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.68-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): ibellicotest+51@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Log in with any Gmail account.
  3. When logged in, tap on "Search" on the bottom of the screen.
  4. Verify that search section and all the content in it, loads smoothly.

Expected Result:

Search section and all the content in it, should load smoothly when opened.

Actual Result:

Search section loads infinitely when opened just after logging in.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6679422_1732821969147.Infinitelly.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863519972369952192
  • Upwork Job ID: 1863519972369952192
  • Last Price Increase: 2024-12-02
Issue OwnerCurrent Issue Owner: @luacmartins

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 28, 2024
  2. melvin-bot commented on Nov 28, 2024

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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.

  3. daledah commented on Nov 29, 2024

    @daledah
    Contributor

    This is a BE Bug. Search API returns no Onyx data.

    Screenshot 2024-11-29 at 08 12 04
  4. huult commented on Nov 29, 2024

    @huult
    Contributor

    Proposal

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

    Search section loads infinitely when opened after logging in

    What is the root cause of that problem?

    We called the search API with this jsonQuery, but the response returned an empty onyxData array.

    jsonQuery: {"type":"expense","status":"all","sortBy":"date","sortOrder":"desc","filters":null,"inputQuery":"type:expense status:all sortBy:date sortOrder:desc","hash":243428839,"recentSearchHash":422547233,"offset":0}
    

    The reason for the empty onyxData array might be that the backend validated the query as having the wrong format or something similar.

    And since onyxData is an empty array, shouldShowLoadingState always returns false, which is why the loading state is not hidden.

    const shouldShowLoadingState = !isOffline && !isDataLoaded;

    if (shouldShowLoadingState) {

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

    To resolve this issue, we need to do two things:

    1. Double-check the JSON query to match the backend's requirements.
    2. Handle the case where onyxData is an empty array.

    //src/components/Search/index.tsx#L308
    +    if (searchResults === undefined && !isOffline) {
    +        setShouldShowStatusBarLoading(false);
    
    +        return (
    +            <View style={[shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3, styles.flex1]}>
    +                <EmptySearchView type={type} />
    +            </View>
    +        );
    +    }
    POC Screenshot 2024-11-29 at 11 37 23

    What alternative solutions did you explore? (Optional)

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 2, 2024
  6. changed the title [-]Search - Search section loads infinitely when opened after logging in[/-] [+][$250] Search - Search section loads infinitely when opened after logging in[/+] on Dec 2, 2024
  7. melvin-bot commented on Dec 2, 2024

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 2, 2024
  9. melvin-bot commented on Dec 2, 2024

    @melvin-bot

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

  10. mountiny commented on Dec 2, 2024

    @mountiny
    Contributor

    cc @luacmartins @lakchote can you have a look into this?

  11. melvin-bot commented on Dec 2, 2024

    @melvin-bot

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

  12. self-assigned this
    on Dec 2, 2024
  13. luacmartins commented on Dec 2, 2024

    @luacmartins
    Contributor

    @daledah the requestID shared here shows no errors for that request. Do you have expense data in that account?

  14. akinwale commented on Dec 3, 2024

    @akinwale
    Contributor

    @huult Could you clarify what you mean by "Double-check the JSON query to match the backend's requirements." in your proposed solution?

  15. huult commented on Dec 3, 2024

    @huult
    Contributor

    @akinwale Yes, I mean we need to check with the backend why this JSON query has returned Onyx with an empty array, and this resolved it

  16. added
    ReviewingHas a PR in review
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    Help WantedApply this label when an issue is open to proposals by contributors
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 3, 2024
  17. luacmartins commented on Dec 3, 2024

    @luacmartins
    Contributor

    This is entirely internal. So gonna unassign BZ and C+

  18. luacmartins commented on Dec 4, 2024

    @luacmartins
    Contributor

    This is fixed

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions