Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

Dev: Web - Console error on split bill in #announce #23316

Closed kbecciv closed 1 year ago

kbecciv commented 1 year ago

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. From userA, create a workspace if not created
  2. Add userB to workspace
  3. Go to #announce
  4. Click on + icon and select split bill option
  5. Enter amount and click on next button
  6. Click on split button
  7. From userB , go to #announce

Expected Result:

It should not show any console error

Actual Result:

console error appears(Failed prop type: The prop chatReport.hasOutstandingIOU is marked as required in MoneyRequestAction, but its value is undefined)

Workaround:

Unknown

Platforms:

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

Version Number: Dev 1.3.43-2 Reproducible in staging?: n/a Reproducible in production?: n/a 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

https://github.com/Expensify/App/assets/93399543/0b7ac7b3-219c-490b-ac27-cf22aa10c6c6

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

View all open jobs on GitHub

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

jfquevedol2198 commented 1 year ago

Proposal

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

Dev: Web - Console error on split bill in #announce

What is the root cause of that problem?

https://github.com/Expensify/App/blob/7fea760c2bb7556815aaca2d61861bd1cf39d6b1/src/components/ReportActionItem/MoneyRequestAction.js#L48 hasOutstandingIOU is a required field.

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

Remove isRequired

    chatReport: PropTypes.shape({
        /** Whether the chat report has an outstanding IOU */
        hasOutstandingIOU: PropTypes.bool,
    }),

What alternative solutions did you explore? (Optional)

N/A

Pujan92 commented 1 year ago

Proposal

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

Console error for split bill in #announce or any group chat

What is the root cause of that problem?

For all group reports(not only for #announce) the backend response is not setting the field hasOutstandingIOU in the onyx data. With this in the MoneyRequestAction component, we have the prop hasOutstandingIOU required(PropTypes.bool.isRequired) but for group reports its value is undefined which is causing the issue chatReport.hasOutstandingIOU` is marked as required in `MoneyRequestAction`, but its value is `undefined.

Screenshot 2023-07-21 at 2 08 11 PM

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

We need to update the prop type by taking out the required(hasOutstandingIOU: PropTypes.bool) in MoneyRequestAction component. https://github.com/Expensify/App/blob/a97ca9b2092c56e7d237e13e56a649cf08993090/src/components/ReportActionItem/MoneyRequestAction.js#L48

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @roryabraham (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

mateocole commented 1 year ago

Hey @roryabraham could you see if you get this same console error in Dev?

roryabraham commented 1 year ago

Saw this console warning on the workspace invite page:

image

Could not reproduce the error shown in the videos above however.