App: [HOLD for payment 2022-12-15] [$250] BUG: Web - Console error when comment in a report is right clicked and context menu is opened - reported by @aneequeahmad

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. Launch web app.
  2. Click on any report having links in comments in LHN
  3. Hover on any comment and right click to open context menu

Expected Result:

no console errors should display

Actual Result:

Console error: Failed prop type: Invalid prop anchor supplied to BaseReportActionContextMenu, expected a ReactNode at BaseReportActionContextMenu

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platform:

Where is this issue occurring?

  • Web

Version Number: 1.2.12-3 Reproducible in staging?: need repro Reproducible in production?: need repro Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/43995119/196144255-575ad966-bfcf-49d6-b6c1-9931c29b18d5.mov

Expensify/Expensify Issue URL: Issue reported by: @aneequeahmad Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1664421573647289

View all open jobs on GitHub

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 86 (57 by maintainers)

Most upvoted comments

Thanks for all the detailed discussion here! After reviewing it, I think we should proceed- please move forward with the PR @aneequeahmad 👍

Payment has been sent.

I tend to agree. It looks like we have testing for reviewing and editing messages so I think we’re covered.

@aneequeahmad has been paid for reporting and fixing the issue plus the 50% bonus for merging the PR in three days.

@aimane-chnaif once you accept the offer in UpWorks I can pay you out for the contributor plus role.

Yeah I’m not sure how that works for testing. I know that reviewers/contributors should check the console to make sure there aren’t errors in places the PR directly affects… So that would have caught this in this specific case. Although actually I’m pretty sure QA has their console up while checking things. So if right clicking the context menu is part of their flow, it should be caught already? Not 100% on that…

So the PR that introduced this bug is definitely this one - none of the related code has been touched since then, and that’s when the anchor prop was created. However it’s also the PR that created the functionality in the first place, I believe, so this was less of a regression and more that testers must not have checked for the console errors?

Let me know if you agree @aimane-chnaif and @robertjchen

Merged! Awaiting deployment.

@aimane-chnaif PR has been raised.

@aneequeahmad We have two days to merge the PR for the 50% bonus to apply. Can we expect the PR tomorrow?

@AhmadbinZahid Since you are the first to propose working solution, if you can explain or share any link that explains why event.nativeEvent.target is always number on iOS (cannot be anything like string, boolean, ReactNodeArray, etc), I’d like to accept your solution.

You didn’t make me convinced on this. And your final answer is for native (which includes android), not only for iOS. And you were still asking what type of anchor is in android since you’re not sure (maybe you don’t have android device to test). We won’t apply this kind of unconfirmed solution which depend on test result without root cause.

And PropTypes.node was original definition in current codebase. You won’t able to guarantee narrowing it to PropTypes.number won’t cause any regression, correct?

@aneequeahmad’s updated proposal looks good to me.

PropTypes.node is for native, PropTypes.object is for web based platforms

cc: @dangrous

🎀 👀 🎀 C+ reviewed

Can anyone confirm what is the typeof anchor in case of android?

object

Reviewing now

@dangrous @aimane-chnaif can you both please review @aneequeahmad’s proposal?