Skip to content

[HOLD for payment 2023-06-30] [$1000] App crashes on pasting the public room URL again after navigating back #20825

Closed

Description

@kavimuru

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


Action Performed:

  1. Go to staging dot on web chrome
  2. Create a public room
    3.Send a message in the room (important step)
  3. Copy the URL of the room and paste it in a new incognito window (without signing in)
  4. Click on reply thread icon of the message and notice that it navigates you to the sign in window.
  5. Now click on back button for the browser and see that a empty window page is seen. Now again paste the URL and hit enter
  6. Result: See that the app crashes

Expected Result:

App should not crash on pasting the public room URL again after navigating back

Actual Result:

App crashes on pasting the public room URL again after navigating back

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.28-3
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
Notes/Photos/Videos: Any additional supporting documentation

error-2023-06-14_09.49.41.mp4
Recording.977.mp4

Expensify/Expensify Issue URL:
Issue reported by: @avi-shek-jha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686715971306539

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0127842e1a6b2e7f94
  • Upwork Job ID: 1669713173384228864
  • Last Price Increase: 2023-06-16

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 15, 2023
  2. melvin-bot commented on Jun 15, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 15, 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
  4. hungvu193 commented on Jun 15, 2023

    @hungvu193
    Contributor

    Proposal

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

    App crashes on pasting the public room URL again after navigating back

    What is the root cause of that problem?

    We're using getTopmostReportId even when the navigation is not ready, which make the state undefined.
    Screen Shot 2023-06-15 at 21 39 42
    Now the app will be crashed because the state is undefined and we are checking for state.routes.

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

    We can update the original getTopmostReportId function here with an early return

    function getTopmostReportId(state) {
        if (!state) {
            return;
        }

    or we can update getTopmostReportId inside Navigation.js to this.

    const getTopmostReportId = (state = navigationRef.getState()) => {
       if (!navigationRef.isReady()) {
           return;
       }
      return  originalGetTopmostReportId(state);
    };

    What alternative solutions did you explore? (Optional)

    N/A

  5. daordonez11 commented on Jun 15, 2023

    @daordonez11
    Contributor

    Hey there @sonialiap as discussed in slack I know this issue still has no external tag and might not become external but here is already draft PR that solves the issue, it might help you avoid additional work

  6. daordonez11 commented on Jun 15, 2023

    @daordonez11
    Contributor

    Proposal

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

    Web app crashes when user inputs again the URL after going back from sign in page

    What is the root cause of that problem?

    After opening the second time the React Navigation library returns an undefined state, which is sent to updateSavedNavigationStateAndLogRoute

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

    Instead of having guards in the children methods I recommend having the guard in the parent NavigationRoot.js:

    const updateSavedNavigationStateAndLogRoute = (state) => {
            if (!state) {
                return
            }
            navigationStateRef.current = state;
            props.updateCurrentReportId(state);
            parseAndLogRoute(state);
        };

    Video of the solution working:
    Mobile Browser - 14_6_2023, 14_55_36.webm
    New Recording - 14_6_2023, 14_54_41.webm

    What alternative solutions did you explore? (Optional)

    I began trying a guard in getTopmostReportId but diving into the origin of the issue it is better to use it in the parent in case any additional method is used in updateSavedNavigationStateAndLogRoute
    We can also validate with Software Mansion and check if the behavior of receiving and undefined state from the library is correct.

  7. melvin-bot commented on Jun 15, 2023

    @melvin-bot

    Looks like something related to react-navigation may have been mentioned in this issue discussion.

    As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

    Feel free to drop a note in #expensify-open-source with any questions.

  8. sonialiap commented on Jun 16, 2023

    @sonialiap
    Contributor

    Reproducible. Moving to external

    Thanks @daordonez11, I'm going to let the C+ review the proposals 👍

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 16, 2023
  10. changed the title [-]App crashes on pasting the public room URL again after navigating back[/-] [+][$1000] App crashes on pasting the public room URL again after navigating back[/+] on Jun 16, 2023
  11. melvin-bot commented on Jun 16, 2023

    @melvin-bot
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 16, 2023
  13. melvin-bot commented on Jun 16, 2023

    @melvin-bot

    Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

  14. 32 remaining items

  15. melvin-bot commented on Jun 23, 2023

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
    • [@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@mollfpr] Determine if we should create a regression test for this bug.
    • [@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. mollfpr commented on Jun 29, 2023

    @mollfpr
    Contributor

    [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:

    #16581

    [@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

    https://github.com/Expensify/App/pull/16581/files#r1246040157

    [@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

    This is a regression for our navigation reboot, so the regression step should be enough.

    [@mollfpr] Determine if we should create a regression test for this bug.
    [@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    1. Go to staging dot on web chrome
    2. Create a public room
    3. Send a message in the room (important step)
    4. Copy the URL of the room and paste it into a new incognito window (without signing in)
    5. Click on the reply thread icon of the message and notice that it navigates you to the sign-in window.
    6. Now click on the back button for the browser and see that an empty window page is seen. Now again, paste the URL and hit enter
    7. Verify the app is not crash
    8. 👍 or 👎
  17. moved this from Review External PR to In Progress in Navigation Refactor Follow-upson Jun 29, 2023
  18. sonialiap commented on Jul 3, 2023

    @sonialiap
    Contributor

    Timeline:
    June 14 9:57pm opened
    June 21 12:27pm merged
    Days: about 3.5
    No merge bonus

  19. sonialiap commented on Jul 3, 2023

    @sonialiap
    Contributor

    @avi-shek-jha offer sent for report - paid ✔️
    @daordonez11 offer sent for fix (+bonus) - paid ✔️
    @mollfpr offer sent for review (+bonus) - paid ✔️

  20. daordonez11 commented on Jul 3, 2023

    @daordonez11
    Contributor

    Hey @sonialiap isn't urgency bonus based assignation? I was assigned on Wednesday 19 and merged by Friday 21 it took only 2 business days. I think it does apply in this case.

  21. moved this from In Progress to Done in Navigation Refactor Follow-upson Jul 4, 2023
  22. mountiny commented on Jul 4, 2023

    @mountiny
    Contributor

    @sonialiap the bonus should apply here, would you be able to update the contracts please? thanks!

  23. sonialiap commented on Jul 5, 2023

    @sonialiap
    Contributor

    Thanks for the correction. The bonus is applied on top of the contract so no need to amend them. Issuing payment with the bonus now ⏳ 💰

  24. sonialiap commented on Jul 5, 2023

    @sonialiap
    Contributor

    @daordonez11 please accept the offer. Bonus is applied during payment after the offer has been accepted :)

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions