You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$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
BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
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
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.
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 .
It happens in validatedSelectionCall in useEffect.
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.
BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Jul 28, 2023
Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)BhuvaneshPatil commentedon Jul 28, 2023
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.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 .
It happens in
validatedSelectionCallin useEffect.App/src/pages/workspace/WorkspaceMembersPage.js
Lines 112 to 114 in 6a38341
What changes do you think we should make in order to solve the problem?
We shall render the
FullPageNotFoundViewinwithPolicyAndFullscreenLoadingThe condition will be -
!props.isLoadingReportDatawe are making sure the request has completed_.isEmpty(props.policy)we check if policy is empty/nullAnd based on that we are showing
<FullPageNotFoundView/>We do have wrapped
WorkspaceMembersPagewithFullPageNotFoundViewbut 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)validateSelectioninsideuseEffect, we can check if theprops.policyis empty, and if it's empty we early return the useEffect callbackWorkspaceMembersPagecomponent, we check ifprops.policyis empty or not and renderFullPageNotFoundView, 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
toLowerCaseon 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)
withPolicyAndFullscreenLoadingand display theFullPageNotFoundView. It will be added to chain afterwithPolicyAndFullscreenLoadingand it will have same check as discussed above and render required output.BhuvaneshPatil commentedon Jul 28, 2023
@kbecciv I was able to reproduce this issue.
kbecciv commentedon Jul 28, 2023
Great, thank you!
melvin-bot commentedon Jul 31, 2023
@kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
kevinksullivan commentedon Aug 1, 2023
Also reproduced
47 remaining items
Pujan92 commentedon Aug 11, 2023
@rushatgabhane PR is ready for review!
alexpensify commentedon Aug 12, 2023
@Pujan92 thank you for the update!
alexpensify commentedon Aug 16, 2023
It looks like the PR is still under review
alexpensify commentedon Aug 18, 2023
The PR is still moving along.
kevinksullivan commentedon Aug 21, 2023
@alexpensify thanks for stepping in! I am back so I can manage the payouts, but will keep you assigned for credit.
Pujan92 commentedon Aug 23, 2023
@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)
kevinksullivan commentedon Aug 24, 2023
Thanks @Pujan92 . Checking on our process for these in slack
kevinksullivan commentedon Aug 24, 2023
Payment made to @Pujan92
kevinksullivan commentedon Aug 24, 2023
Offer sent to @hichamcc for reporting. Let me know when you've accepted!
hichamcc commentedon Aug 24, 2023
@kevinksullivan accepted
kevinksullivan commentedon Aug 25, 2023
All set here
JmillsExpensify commentedon Oct 5, 2023
Can I get a payment summary on this issue?
kevinksullivan commentedon Oct 9, 2023
@JmillsExpensify
Reporter: @hichamcc $250
Contributor: @Pujan92 $1,000
C+: @rushatgabhane $1,000
JmillsExpensify commentedon Oct 9, 2023
$1,000 payment approved for @rushatgabhane based on BZ summary.