App icon indicating copy to clipboard operation
App copied to clipboard

[C+ Checklist Needs Completion] [$75] Migrate withReportAndPrivateNotesOrNotFound from withOnyx to useOnyx

Open roryabraham opened this issue 1 year ago • 27 comments

Coming from https://expensify.slack.com/archives/C01GTK53T8Q/p1725973460005309?thread_ts=1725905735.105989&cid=C01GTK53T8Q

Migrate src/pages/home/report/withReportAndPrivateNotesOrNotFound.tsx to use useOnyx instead of withOnyx.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834283616679002875
  • Upwork Job ID: 1834283616679002875
  • Last Price Increase: 2024-09-12
  • Automatic offers:
    • akinwale | Reviewer | 103949144
    • nkdengineer | Contributor | 103949146
Issue OwnerCurrent Issue Owner: @akinwale

roryabraham avatar Sep 12 '24 17:09 roryabraham

Triggered auto assignment to @greg-schroeder (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.

melvin-bot[bot] avatar Sep 12 '24 17:09 melvin-bot[bot]

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

melvin-bot[bot] avatar Sep 12 '24 17:09 melvin-bot[bot]

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

melvin-bot[bot] avatar Sep 12 '24 17:09 melvin-bot[bot]

Upwork job price has been updated to $100

melvin-bot[bot] avatar Sep 12 '24 17:09 melvin-bot[bot]

Upwork job price has been updated to $75

melvin-bot[bot] avatar Sep 12 '24 17:09 melvin-bot[bot]

Proposal

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

Migrate withReportAndPrivateNotesOrNotFound from withOnyx to useOnyx

What is the root cause of that problem?

This is a migration

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

Remove the withOnyx here and use useOnyx. Also, remove the onyx-type props here

https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/pages/home/report/withReportAndPrivateNotesOrNotFound.tsx#L94

What alternative solutions did you explore? (Optional)

NA

nkdengineer avatar Sep 12 '24 17:09 nkdengineer

resilienta Your proposal will be dismissed because you did not follow the proposal template.

github-actions[bot] avatar Sep 12 '24 17:09 github-actions[bot]

Proposal

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

Migrate withReportAndPrivateNotesOrNotFound from withOnyx to useOnyx

What is the root cause of that problem?

Feature request

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

remove withOnyx from here https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/pages/home/report/withReportAndPrivateNotesOrNotFound.tsx#L93-L100

And also we need to add

  const [session] = useOnyx(ONYXKEYS.SESSION);

We should also remove session from here https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/pages/home/report/withReportAndPrivateNotesOrNotFound.tsx#L36 Optional: we can also remove type props.

What alternative solutions did you explore? (Optional)

Nodebrute avatar Sep 12 '24 17:09 Nodebrute

Edited by proposal-police: This proposal was edited at 2024-09-12 17:40:14 UTC.

[## Proposal

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

Migration of withOnyx to useOnyx

What is the root cause of that problem?

Migration

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

Remove these lines and remove prop types for the same -

https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/pages/home/report/withReportOrNotFound.tsx#L107-L123

We shall convert it to useOnyx hook.

const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA)

and same for other keys as well

What alternative solutions did you explore? (Optional)

NA

BhuvaneshPatil avatar Sep 12 '24 17:09 BhuvaneshPatil

📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Sep 13 '24 16:09 melvin-bot[bot]

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] avatar Sep 13 '24 16:09 melvin-bot[bot]

PR in review

greg-schroeder avatar Sep 17 '24 01:09 greg-schroeder

@akinwale is next up!

greg-schroeder avatar Sep 19 '24 01:09 greg-schroeder

@roryabraham has final review here then should be good to merge it appears

greg-schroeder avatar Sep 23 '24 03:09 greg-schroeder

Left a review. This might need to HOLD on withReportOrNotFound

roryabraham avatar Sep 27 '24 19:09 roryabraham

Okay, thanks Rory! I'll keep my eye out and adjust if needed

greg-schroeder avatar Sep 27 '24 19:09 greg-schroeder

PR is still under review

greg-schroeder avatar Oct 01 '24 02:10 greg-schroeder

going on parental leave, need to reassign. @youssef-lr I'm choosing you at random, hope you don't mind ❤️

roryabraham avatar Oct 04 '24 23:10 roryabraham

PR is still under review

greg-schroeder avatar Oct 08 '24 21:10 greg-schroeder

Looks like @youssef-lr is next up to complete the final requested review on the PR

greg-schroeder avatar Oct 14 '24 21:10 greg-schroeder

Review in progress

youssef-lr avatar Oct 18 '24 22:10 youssef-lr

This is on staging. Awaiting deploy to prod

greg-schroeder avatar Oct 24 '24 19:10 greg-schroeder

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

melvin-bot[bot] avatar Oct 25 '24 02:10 melvin-bot[bot]

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

  • https://github.com/Expensify/App/pull/49238

If no regressions arise, payment will be issued on 2024-11-01. :confetti_ball:

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

melvin-bot[bot] avatar Oct 25 '24 02:10 melvin-bot[bot]

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:

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

melvin-bot[bot] avatar Oct 25 '24 02:10 melvin-bot[bot]

Could you complete the checklist @akinwale? Thanks!

greg-schroeder avatar Nov 01 '24 20:11 greg-schroeder

  • [x] [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [x] [@akinwale] 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:
  • [x] [@akinwale] 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:

Not a regression. This is a migration.

  • [x] [@akinwale] Determine if we should create a regression test for this bug.
  • [x] [@akinwale] 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.

Regression Test Steps

  1. Launch Expensify
  2. Create a workspace
  3. Navigate to the workspace chat
  4. Click on the chat header and select Details > Private notes
  5. Attempt to edit the private notes
  6. Verify that editing and saving private notes works properly.

Do we agree 👍 or 👎?

akinwale avatar Nov 02 '24 04:11 akinwale