Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-08-24] [$1000] Dev: Web - Console log on clicking IOU preview component #23645

Closed
1 of 6 tasks
kbecciv opened this issue Jul 26, 2023 · 69 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Jul 26, 2023

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. Open a tab where account A is signed in
  2. Request a money from account B
  3. Open a tab where account B is signed in
  4. Open chat between account B & A
  5. Click on the IOU preview component

Expected Result:

There should be no console log error

Actual Result:

Console log error displayed [Failed prop type: Invalid prop personalDetails.accountID of type number supplied to IOUPreview, expected object.]

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: Dev 1.3.45-8
Reproducible in staging?: no
Reproducible in production?: no
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

Screencast.from.2023-07-26.16-09-36.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690377355421559

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f09e3655eab4d213
  • Upwork Job ID: 1686463669325656064
  • Last Price Increase: 2023-08-08
  • Automatic offers:
    • situchan | Reviewer | 26052727
    • Nodebrute | Contributor | 26052728
    • Natnael-guchima | Reporter | 26052736
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 29, 2023

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

@maddylewis
Copy link
Contributor

heya @deetergp - since this is happening on Dev, we will need an engineer to help with the reproduction steps. thank you!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 29, 2023
@deetergp
Copy link
Contributor

deetergp commented Aug 1, 2023

I walked through the reproduction steps and can confirm that I am seeing that same console error. It does look as though it is something an external contributor can work on.

@melvin-bot melvin-bot bot removed the Overdue label Aug 1, 2023
@deetergp deetergp added the External Added to denote the issue can be worked on by a contributor label Aug 1, 2023
@melvin-bot melvin-bot bot changed the title Dev: Web - Console log on clicking IOU preview component [$1000] Dev: Web - Console log on clicking IOU preview component Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01f09e3655eab4d213

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

@icarus-0520
Copy link

Proposal from upwork

One possible source of the error is in the proptypes declaration in IOUPreview.js, specifically the personal details key found in lines 83-88. Only one key is declared as belonging to the object, displayName. The first thing I would do is add accountID to this declaration and test to see if this solves the problem. Whether it does or doesn't, the next move would be to find the full JSON object that is being passed and create an interface for it to ensure safety. If this theory does not pan out, my next move would be to add logs throughout function ReportActionItemSingle in ReportActionItemSingle.js, lines 73-183, and function MoneyRequestAction in MoneyRequestAction.js, lines 87-157, to determine the values that are available and set throughout, and compare these with the values expected by IOUPreview. Generally, the solution will be to identify whether the issue lies in inheritance (something goes wrong with the data en route to IOUPreview) or declaration (IOUPreview's expected props are inaccurate), and from there implementing the most efficient type safeguards.

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

📣 @icarus-0520! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@icarus-0520
Copy link

Contributor details
Expensify account email: aidan@disillusion.io
Upwork Profile Link: https://www.upwork.com/freelancers/~01ee97b9ff5ee5d693

@Nodebrute
Copy link
Contributor

Nodebrute commented Aug 3, 2023

Proposal

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

Dev: Web - Console log on clicking IOU preview component

What is the root cause of that problem?

This bug is easily reproducible on all the pages where we are using

personalDetailsList: PropTypes.objectOf(personalDetailsPropType),

and
personalDetails: PropTypes.objectOf(personalDetailsPropType),

It's the way we are checking the prototype here. In SubscriptAvatar Look how we are checking for an object we should do the same here

mainAvatar: avatarPropTypes,

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

We need to fix this globally in all the components where this issue is occurring. There are around 15 components with this error.
For Example in
ReportActionCompose
WithCurrentUserPersonalDetails
ReportActionItemSingle
ReportActionItem

We can remove PropTypes.objectOf
and change it to

 personalDetailsList: personalDetailsPropType,

and for personal details we can change it to

    personalDetails: participantPropTypes,

We can also add isRequired in all the places where this prop is required.

What alternative solutions did you explore? (Optional)

Here, we have different issues. In case we decide to fix it here. The parentReportID string issue was introduced almost one day ago in this PR: #23621. It was also caught during the review of that PR: #23621 (comment). Here is a link to the related bug that I reported yesterday: https://expensify.slack.com/archives/C049HHMV9SM/p1691035111039979. We can change this to a number to fix it
We can change this to a number

parentReportID: PropTypes.string,

like this

 /** parent Report ID */
    parentReportID: PropTypes.number,

or

 parentReportID: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),

There is some inconsistency across the app where, in certain instances, we are utilizing 'personalDetails' as PropTypes, while in other cases, we are using 'personalDetailsList'. To ensure uniformity throughout the app, it's recommended that we maintain a consistent naming convention for our PropTypes.

If we want, we can fix it from the root. The OpenReport API returns a number instead of a string. It will require a backend fix to return a string here.

@melvin-bot melvin-bot bot added the Overdue label Aug 3, 2023
@alexxxwork
Copy link
Contributor

Proposal

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

Console log error displayed [Failed prop type: Invalid prop parentReportID of type number supplied to ParentNavigationSubtitle, expected string.]

What is the root cause of that problem?

This issue is caused by backend returning parentReportID of type Number instead of string

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

we could just use toString() to convert parentReportID to string as we already do here

<ParentNavigationSubtitle
parentNavigationSubtitleData={parentNavigationSubtitleData}
parentReportID={props.report.parentReportID}
pressableStyles={[styles.alignSelfStart, styles.mw100]}
/>

What alternative solutions did you explore? (Optional)

First of all various values of reportID and parentReportID should be consistent in backend replies - number or string. Then we could apply changes all over the codebase to change ReportIDs to type number.

@deetergp
Copy link
Contributor

deetergp commented Aug 3, 2023

@alexxxwork Can you trace back which API calls are returning reportID as numbers instead of strings?

@melvin-bot melvin-bot bot removed the Overdue label Aug 3, 2023
@melvin-bot melvin-bot bot removed the Overdue label Aug 15, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Aug 15, 2023

Thanks @situchan , I will relogin and check.

@conorpendergrast
Copy link
Contributor

@Pujan92 All good after logout and login?

@conorpendergrast
Copy link
Contributor

@maddylewis Ah, you're back! I'll unassign myself, assign me again if you need any more help!

@conorpendergrast conorpendergrast removed their assignment Aug 16, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Aug 16, 2023

@Pujan92 All good after logout and login?

Yes @conorpendergrast, not seeing the warnings now.

@conorpendergrast
Copy link
Contributor

Fantastic, thanks for confirming!

@conorpendergrast conorpendergrast removed the Needs Reproduction Reproducible steps needed label Aug 16, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 17, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Dev: Web - Console log on clicking IOU preview component [HOLD for payment 2023-08-24] [$1000] Dev: Web - Console log on clicking IOU preview component Aug 17, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.54-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-08-24. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@maddylewis] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@maddylewis maddylewis added Daily KSv2 and removed Weekly KSv2 labels Aug 21, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@maddylewis
Copy link
Contributor

moving to daily since payment is coming up this week

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Aug 21, 2023
@maddylewis
Copy link
Contributor

maddylewis commented Aug 24, 2023

Payments


@maddylewis
Copy link
Contributor

@situchan - will you lmk if any of this checklist needs to be reviewed? thanks! #23645 (comment)

@situchan
Copy link
Contributor

@maddylewis this is eligible for bonus. You didn't calculate weekend

@situchan
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR: #20679
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/20679/files#r1304805631

Console error is already in checklist. No need regression test

@maddylewis
Copy link
Contributor

everyone is paid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants