Skip to content

[$500] Deeplinks - Infinite loading displayed when user navigated on non-existing chat deeplink #33638

Closed

Description

@lanitochka17

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: 1.4.17.1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Precondition: app should be killed

  1. Open app
  2. Open any existing coversation
  3. Hide the app
  4. Open non-existing coversation deeplink https://staging.new.expensify.com/r/1234

Expected Result:

User should be navigated on "You don't have access to this chat" page

Actual Result:

Infinite loading displayed

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

Bug6326513_1703637346495.Rpreplay_Final1703617339.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bad93f473888207b
  • Upwork Job ID: 1739822788800614400
  • Last Price Increase: 2024-01-24
  • Automatic offers:
    • tienifr | Contributor | 28121883

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 27, 2023
  2. changed the title [-] Deeplinks - Infinite loading displayed when user navigated on non-existing chat deeplink[/-] [+][$500] Deeplinks - Infinite loading displayed when user navigated on non-existing chat deeplink[/+] on Dec 27, 2023
  3. melvin-bot commented on Dec 27, 2023

    @melvin-bot
  4. melvin-bot commented on Dec 27, 2023

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 27, 2023
  6. melvin-bot commented on Dec 27, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Dec 27, 2023

    @melvin-bot

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

  8. tienifr commented on Dec 27, 2023

    @tienifr
    Contributor

    Proposal

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

    Infinite loading displayed

    What is the root cause of that problem?

    We're reusing ReportScreen even though the reportID in route changes.

    See here, when the reportID in route changes, the same ReportScreen instance will be used. So the wasReportAccessibleRef in here is still true, even though now it's a new report and it should be evaluated again. This causes the shouldShowNotFoundPage here to always be false, preventing the not found screen from opening.

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

    Add route reportID as key of ReportScreen.

    We can do this by modify this to

    <ReportScreen route={route} key={getReportID(route)}/>
    

    (The getReportID is the same as here)

    What alternative solutions did you explore? (Optional)

    If we want to keep the ReportScreen render shared between different reportIDs, we need to reset the wasReportAccessibleRef to false when the reportID from route change (and potentially the firstRenderRef to true as well), and modify the condition here so that it will not set wasReportAccessibleRef to false if the reportID of report and reportID from route doesn't match.

  9. wildan-m commented on Dec 27, 2023

    @wildan-m
    Contributor

    Proposal

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

    Deeplinks - Infinite loading displayed when user navigated on non-existing chat deeplink

    What is the root cause of that problem?

    In native, ReportScreen is not actually unmounted when there is a change in reportID.

    When the reportID known to be invalid it will hit this check in ReportScreen.

    onyxReportID === prevReport.reportID && (!onyxReportID
    

    onyxReportID and prevReport.reportID will be undefined.

    This will cause infinite loading since isLoadingInitialReportActions never false and wasReportAccessibleRef.current will always be true.

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

    When reportID known to be invalid, we can mark wasReportAccessibleRef.current and isLoadingInitialReportActions to false

            if ((onyxReportID === prevReport.reportID && (!onyxReportID || onyxReportID === routeReportID))) {
                if(!onyxReportID)
                {
                    wasReportAccessibleRef.current = false;
                    Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`, {isLoadingInitialReportActions: false});
                }
                return;
            }
    
    
  10. garrettmknight commented on Dec 29, 2023

    @garrettmknight
    Contributor

    @sobitneupane any thoughts on these proposals?

  11. 51 remaining items

  12. sobitneupane commented on Feb 20, 2024

    @sobitneupane
    Contributor

    I am expecting updates from @tienifr in the PR.

  13. sobitneupane commented on Mar 5, 2024

    @sobitneupane
    Contributor

    The issue was resolved by #36477 PR. So, we are going to close the PR #35228 created for this issue.

  14. marcochavezf commented on Mar 5, 2024

    @marcochavezf
    Contributor

    Oh then the issue is no longer reproducible in main, correct?

  15. tienifr commented on Mar 6, 2024

    @tienifr
    Contributor

    @marcochavezf That's true.

  16. garrettmknight commented on Mar 8, 2024

    @garrettmknight
    Contributor

    Gotcha, gonna close in that case.

  17. tienifr commented on Mar 11, 2024

    @tienifr
    Contributor

    @garrettmknight Although the issue was fixed somewhere else, efforts have been made to implement, test and review carefully the PR. Please consider payment for this issue. Thanks!

  18. tienifr commented on Mar 14, 2024

    @tienifr
    Contributor

    @garrettmknight Can you check the above ^. Thanks 🙏

  19. garrettmknight commented on Mar 14, 2024

    @garrettmknight
    Contributor

    Hey @tienifr - missed the first comment. I think half payment is fair. I'll process now.

    Summary of Payments:

  20. garrettmknight commented on Mar 14, 2024

    @garrettmknight
    Contributor

    @sobitneupane can you request payment when you get a chance?

  21. JmillsExpensify commented on Mar 22, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @sobitneupane based on summary.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions