Skip to content

[$1000] Web - Error message "Uh-oh, something went wrong!" when trying to access a workspace member's URL while logged into a different account #23814

Closed

Description

@kbecciv

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. Connect with user A
  2. Create a workspace
  3. Copy the members' URL of the workspace
  4. Connect with user B
  5. Past the URL
  6. Observe "Uh-oh, something went wrong!"

Expected Result:

"Hmm... it's not here" screen should appear

Actual Result:

"Uh-oh, something went wrong!" screen appears

Workaround:

Unknown

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.47-2
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

member-url.webm

Expensify/Expensify Issue URL:
Issue reported by: @hichamcc
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690540270820769

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012c0477dc8cdb9db7
  • Upwork Job ID: 1686459517550612480
  • Last Price Increase: 2023-08-01
  • Automatic offers:
    • Pujan92 | Contributor | 26055047

Activity

  1. added
    Daily
    Needs Reproduction
    Bug
    on Jul 28, 2023
  2. melvin-bot commented on Jul 28, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 28, 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. BhuvaneshPatil commented on Jul 28, 2023

    @BhuvaneshPatil
    Contributor

    Proposal

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

    Error message "Uh-oh, something went wrong!" when trying to access a workspace member's URL while logged into a different account

    What is the root cause of that problem?

    In case of user not having access to policy. As we can see in screenshot below, we are getting policy as null.
    Screenshot 2023-07-29 at 12 00 28 AM

    Because the user is not member of workspace/policy.
    And as policy is being passed as empty object/null and we are trying to apply function on undefined .
    Screenshot 2023-07-28 at 11 57 11 PM

    It happens in validatedSelectionCall in useEffect.

    useEffect(() => {
    validateSelection();
    }, [props.preferredLocale, validateSelection]);

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

    We shall render the FullPageNotFoundView in withPolicyAndFullscreenLoading
    The condition will be -

            if(!props.isLoadingReportData && _.isEmpty(props.policy)){
                return <FullPageNotFoundView shouldShow/>
            }
    
    • with !props.isLoadingReportData we are making sure the request has completed
    • with _.isEmpty(props.policy) we check if policy is empty/null

    And based on that we are showing <FullPageNotFoundView/>

    We do have wrapped WorkspaceMembersPage with FullPageNotFoundView but because of error it's not working as expected.

    Other places where we can add check instead of withPolicyAndFullscreenLoading (because it's being used at many places)

    • When we are calling validateSelection inside useEffect, we can check if the props.policy is empty, and if it's empty we early return the useEffect callback
    • At the top level of WorkspaceMembersPage component, we check if props.policy is empty or not and render
      FullPageNotFoundView, IMO it's not a optimised solution.

    As @rushatgabhane commented -
    How about we take care of null values of policy in all related function, so that crash doesn't happen?

    The error is occurring when we access owner of policy that is null and applying toLowerCase on it.
    We can pass the empty string instead of ownerID when policy is null.

    Result -

    Screen.Recording.2023-07-29.at.12.14.39.AM.mov

    What alternative solutions did you explore? (Optional)

    • We can create an HOC for this purpose like we have withPolicyAndFullscreenLoading and display the FullPageNotFoundView. It will be added to chain after withPolicyAndFullscreenLoading and it will have same check as discussed above and render required output.
  5. BhuvaneshPatil commented on Jul 28, 2023

    @BhuvaneshPatil
    Contributor

    @kbecciv I was able to reproduce this issue.

  6. kbecciv commented on Jul 28, 2023

    @kbecciv
    Author

    Great, thank you!

  7. melvin-bot commented on Jul 31, 2023

    @melvin-bot

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

  8. kevinksullivan commented on Aug 1, 2023

    @kevinksullivan
    Contributor

    Also reproduced

  9. added and removed
    Needs Reproduction
    on Aug 1, 2023
  10. 47 remaining items

  11. Pujan92 commented on Aug 11, 2023

    @Pujan92
    Contributor

    @rushatgabhane PR is ready for review!

  12. alexpensify commented on Aug 12, 2023

    @alexpensify
    Contributor

    @Pujan92 thank you for the update!

  13. alexpensify commented on Aug 16, 2023

    @alexpensify
    Contributor

    It looks like the PR is still under review

  14. alexpensify commented on Aug 18, 2023

    @alexpensify
    Contributor

    The PR is still moving along.

  15. kevinksullivan commented on Aug 21, 2023

    @kevinksullivan
    Contributor

    @alexpensify thanks for stepping in! I am back so I can manage the payouts, but will keep you assigned for credit.

  16. Pujan92 commented on Aug 23, 2023

    @Pujan92
    Contributor

    @kevinksullivan @alexpensify Seems some other PR resolved the issue before my PR got merged. In this case, I need to close my PR based on #24457 (comment)

  17. kevinksullivan commented on Aug 24, 2023

    @kevinksullivan
    Contributor

    Thanks @Pujan92 . Checking on our process for these in slack

  18. kevinksullivan commented on Aug 24, 2023

    @kevinksullivan
    Contributor

    Payment made to @Pujan92

  19. kevinksullivan commented on Aug 24, 2023

    @kevinksullivan
    Contributor

    Offer sent to @hichamcc for reporting. Let me know when you've accepted!

  20. hichamcc commented on Aug 24, 2023

    @hichamcc
  21. kevinksullivan commented on Aug 25, 2023

    @kevinksullivan
    Contributor

    All set here

  22. JmillsExpensify commented on Oct 5, 2023

    @JmillsExpensify
    Contributor

    Can I get a payment summary on this issue?

  23. kevinksullivan commented on Oct 9, 2023

    @kevinksullivan
    Contributor

    @JmillsExpensify

    Reporter: @hichamcc $250
    Contributor: @Pujan92 $1,000
    C+: @rushatgabhane $1,000

  24. JmillsExpensify commented on Oct 9, 2023

    @JmillsExpensify
    Contributor

    $1,000 payment approved for @rushatgabhane based on BZ summary.

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

Metadata

Metadata

Labels

BugEngineeringExternalReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions