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 2024-10-10] [$250] [Dev] Console Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? #49062

Closed
1 of 6 tasks
m-natarajan opened this issue Sep 12, 2024 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Sep 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.30-9
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
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
Expensify/Expensify Issue URL:
Issue reported by: @c3024
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1726072515490119?thread_ts=1726072125.690969&cid=C049HHMV9SM

Action Performed:

  1. Logon to ND on iOS App
  2. Go to the self DM page

Expected Result:

No console warning

Actual Result:

Console Warning

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834579040151664712
  • Upwork Job ID: 1834579040151664712
  • Last Price Increase: 2024-09-13
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @joekaufmanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@joekaufmanexpensify
Copy link
Contributor

Getting help reproducing this, since it's a dev environment bug

@bernhardoj
Copy link
Contributor

Proposal

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

Console warning when open a self DM report.

What is the root cause of that problem?

The console warning tells that we are passing a ref prop to a functional component without usign forwardRef. The main culprit is from the withOnyx and the other one is from the withCurrentUserPersonalDetails hook.

If we see at the OP screenshots, it's coming from ReportTypingIndicator, but it actually happens on a lot of places and potentially on all component that uses withOnyx.

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

Replace withOnyx usage with useOnyx hook. There are still a lot of withOnyx usage on the codebase, so we can focus on this issue on some component that triggers the warning in self DM.

Here is the list of the component where we can replace the withOnyx to useOnyx and withCurrentUserPersonalDetails to useCurrentUserPersonalDetails.

  • AttachmentModal
  • ReportActionItem
  • ReportActionItemCreated
  • ReportActionsList
  • ReportTypingIndicator
  • UserTypingEventListener
  • ReportActionCompose

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 13, 2024
@melvin-bot melvin-bot bot changed the title [Dev] Console Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? [$250] [Dev] Console Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

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

@allroundexperts
Copy link
Contributor

@bernhardoj's proposal has the correct RCA and the proposed solution should fix the issue as well. Let's go with them!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 15, 2024

Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 16, 2024
@gijoe0295 gijoe0295 mentioned this issue Sep 16, 2024
50 tasks
@joekaufmanexpensify joekaufmanexpensify removed the Needs Reproduction Reproducible steps needed label Sep 17, 2024
@joekaufmanexpensify
Copy link
Contributor

@bernhardoj is there an ETA for PR here?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 18, 2024
@bernhardoj
Copy link
Contributor

Sorry, I was sick. PR is ready.

cc: @allroundexperts

@joekaufmanexpensify
Copy link
Contributor

Hope you're feeling better, and TY!

@joekaufmanexpensify
Copy link
Contributor

PR in review

@joekaufmanexpensify
Copy link
Contributor

PR still in review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 3, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Dev] Console Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? [HOLD for payment 2024-10-10] [$250] [Dev] Console Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? Oct 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

Copy link

melvin-bot bot commented Oct 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.43-6 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 2024-10-10. 🎊

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

  • @allroundexperts requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests
  • @c3024 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Oct 3, 2024

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:

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

@joekaufmanexpensify
Copy link
Contributor

@allroundexperts, could you handle the checklist so I can prep for payment?

@allroundexperts
Copy link
Contributor

@joekaufmanexpensify I don't think a regression test and the checklist makes much sense here since the functionality is un-effected. Let me know if you think otherwise.

@joekaufmanexpensify
Copy link
Contributor

Ah, yeah that is fair. TY!

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2024
@joekaufmanexpensify
Copy link
Contributor

There is no reporting bonus anymore, so payment is due to @c3024 for this one.

@joekaufmanexpensify
Copy link
Contributor

Only payment due here is:

@joekaufmanexpensify
Copy link
Contributor

joekaufmanexpensify commented Oct 9, 2024

Both of you, feel free to request payment whenever you're ready! I'm going to close the issue in the meantime, but lmk if anything else is needed!

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@JmillsExpensify
Copy link

$250 approved for @allroundexperts

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 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

7 participants