App: [Hold for payment 2021-08-17] Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens

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 URL, enter the workspace URL without any policyID
  2. It updates the URL as workspace/undefined/card
  3. Blank page with the card is shown
  4. Same gets reproduced by putting any random workspace policyId in the URL workspace/<randomId>/card, workspace/<randomId>/people

Expected Result:

  1. Should’ve redirected to the Home page
  2. Or should’ve opened the Settings Page with a Not Found design

https://user-images.githubusercontent.com/3069065/127743694-452877e7-2ebe-4f9f-8641-b89c35c6486f.mp4

Actual Result:

Empty Sidebar + List with WorkspacePeople Page https://user-images.githubusercontent.com/3069065/127743007-cb235857-daaa-402f-bc1a-28f76e36b7fc.mp4

Empty Sidebar with WorkspaceCard Page https://user-images.githubusercontent.com/3069065/127743012-c6cc58ae-50cf-4b0e-bfa1-ebaad0f9a5d3.mp4

Workaround:

Yes. No blocker impact.

Platform:

Where is this issue occurring?

  • Web
  • Mobile Web

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:

View all open jobs on Upwork

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

Done! @mananjadhav I also upped the price to include the bonus amount you receive for finding/proposing the issue.

Paid.

@arielgreen PR is merged for this as of yesterday

Nice! I like that simple approach here. @arielgreen Let’s hire @mananjadhav for this please 🙏

@mananjadhav Thanks for the clarification.

I am not aware if policy will get changed anywhere. If it does, then yeah we’ll have to add it as a dependency. Empty brackets [], will act as a componentDidMount for class components.

It was already set up like this but can you please elaborate on this.

Earlier it was just returning null. Now we’re calling Navigation.dismissModal. In the console tab of devtools you’ll find the following error/warning.

Warning: Cannot update a component (`ForwardRef(BaseNavigationContainer)`) while rendering a different component (`WorkspaceSidebar`). To locate the bad setState() call inside `WorkspaceSidebar`, follow the stack trace as describ