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

Add createdReportActionID to sendMoney and requestMoney #13502

Merged
merged 3 commits into from
Jan 16, 2023

Conversation

youssef-lr
Copy link
Contributor

@youssef-lr youssef-lr commented Dec 10, 2022

Details

Building the created report action and passing its id to the request money and sen money flows when we create chats as well!

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/247419

Tests

Must be tested with Auth, Web

  • Verify that no errors appear in the JS console

Offline tests

Send Money

  1. Go offline
  2. Send money to a user you've never chatted with before.
  3. Go to Dev tools => Application => IndexedDB => OnyxDB => keyvaluepairs => Search for reportActions_<chatReportID>
  4. Note down the CREATED reportActionID
  5. Go back online.
  6. Run script/sql.sh >select * from reportActions where reportActionID=<the reportActionID you noted down>;
  7. Verify the report action exists and has the same ID as the one from step 4.

Request Money

The same steps as above, except in the 'Request money' flow.

QA Steps - Regression tests

Refer to this PR for tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
request.money.mov
send.money.mov
Mobile Web - Chrome image
Mobile Web - Safari image
Desktop image
iOS

Not needed as the changes are not platform specific.

Android image

@youssef-lr youssef-lr self-assigned this Dec 12, 2022
@youssef-lr youssef-lr changed the title Add createdReportActionID to sendMoney and requestMoney [HOLD Web-E #35803] Add createdReportActionID to sendMoney and requestMoney Dec 13, 2022
@youssef-lr youssef-lr marked this pull request as ready for review December 13, 2022 04:59
@youssef-lr youssef-lr requested a review from a team as a code owner December 13, 2022 04:59
@melvin-bot melvin-bot bot requested review from eVoloshchak and srikarparsi and removed request for a team December 13, 2022 04:59
@melvin-bot
Copy link

melvin-bot bot commented Dec 13, 2022

@eVoloshchak @srikarparsi One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@youssef-lr
Copy link
Contributor Author

Note: the HOLD is for merging only. This is ready for review internally so I'm removing the C+ assignment.

@youssef-lr youssef-lr removed the request for review from eVoloshchak December 13, 2022 05:01
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youssef-lr What about split bill is that covered in different PRs?

It is I see in slack

src/libs/actions/IOU.js Show resolved Hide resolved
@srikarparsi
Copy link
Contributor

Hey @youssef-lr, I'm unassigning myself from this pr as I'm taking a break to finish up classes this semester.

@srikarparsi srikarparsi removed their request for review January 2, 2023 21:28
@chiragsalian
Copy link
Contributor

The Web-E PR has been merged. Let's try to get this reviewed/approved so that it can be merged the moment the web-E code is live 🙇‍♂️

So friendly bump for the reviewers @flodnv & @mountiny

@mountiny mountiny self-assigned this Jan 12, 2023
@mountiny
Copy link
Contributor

Since Youssef is ooo, I will look into this tomorrow morning hopefully.

src/libs/ReportUtils.js Outdated Show resolved Hide resolved
@flodnv flodnv changed the title [HOLD Web-E #35803] Add createdReportActionID to sendMoney and requestMoney Add createdReportActionID to sendMoney and requestMoney Jan 13, 2023
@mountiny mountiny changed the title Add createdReportActionID to sendMoney and requestMoney [HOLD Web#35803] Add createdReportActionID to sendMoney and requestMoney Jan 13, 2023
@mountiny mountiny requested a review from flodnv January 13, 2023 13:38
Copy link
Contributor

@flodnv flodnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's going to do the reviewer checklist? 😅

Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, going to run through the checklist

@thienlnam
Copy link
Contributor

thienlnam commented Jan 13, 2023

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Screenshot 2023-01-13 at 11 24 37 AM
Mobile Web - Chrome Screenshot 2023-01-13 at 11 29 47 AM
Mobile Web - Safari Screenshot 2023-01-13 at 11 41 13 AM
Desktop Screenshot 2023-01-13 at 11 42 08 AM
iOS Screenshot 2023-01-13 at 11 40 17 AM
Android Android emulator borked, but changes here are pretty safe cross platform

@thienlnam
Copy link
Contributor

thienlnam commented Jan 13, 2023

Screenshot 2023-01-13 at 11 25 47 AM

Hmm, on mobile chrome it did not redirect to the chat after sending money

Okay nevermind, seems to work now?

@thienlnam
Copy link
Contributor

Screenshot 2023-01-13 at 11 39 51 AM

Getting this console log error, not sure if it's related to this PR but pointing it out in case it is

@roryabraham
Copy link
Contributor

Getting this console log error, not sure if it's related to this PR but pointing it out in case it is

I think it's unrelated, and anyways I fixed it as part of #13465

@mountiny mountiny changed the title [HOLD Web#35803] Add createdReportActionID to sendMoney and requestMoney Add createdReportActionID to sendMoney and requestMoney Jan 16, 2023
@mountiny
Copy link
Contributor

Off hold, merging 🎉

@mountiny mountiny merged commit 2552208 into main Jan 16, 2023
@mountiny mountiny deleted the youssef_createdReportAction_ious branch January 16, 2023 20:04
@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 681.010 ms → 686.494 ms (+5.484 ms, +0.8%)
Open Search Page TTI 596.738 ms → 600.380 ms (+3.642 ms, +0.6%)
App start regularAppStart 0.020 ms → 0.016 ms (-0.004 ms, -17.8%) 🟢
App start nativeLaunch 19.571 ms → 19.567 ms (-0.005 ms, ±0.0%)
App start runJsBundle 197.750 ms → 192.469 ms (-5.281 ms, -2.7%)
Show details
Name Duration
App start TTI Baseline
Mean: 681.010 ms
Stdev: 34.253 ms (5.0%)
Runs: 624.3547219997272 632.9102750001475 635.2648989995942 640.3236940000206 644.6521190004423 644.7878559995443 645.1551679996774 647.8721139999107 651.2976230001077 652.1697410000488 657.2436260003597 660.5755500001833 661.2825389998034 667.9095470001921 672.1453579999506 673.3455649996176 690.7656039996073 690.918514999561 691.2782319998369 697.2030649995431 701.2781800003722 702.9366549998522 703.3240099996328 703.4034909997135 705.8829669998959 713.4866650002077 713.8616110002622 723.8043929999694 723.8237889995798 726.6428220001981 731.9280319996178 760.490499000065

Current
Mean: 686.494 ms
Stdev: 30.713 ms (4.5%)
Runs: 637.2686989996582 639.4240030003712 647.4984860001132 650.490507000126 650.5411860002205 651.7198660001159 651.7310229996219 663.985414000228 666.1654409999028 667.7454110002145 668.8619659999385 675.9244429999962 676.05796200037 676.4150000000373 680.572166999802 684.8558250004426 686.2108739996329 687.8658640002832 690.6387919997796 690.750052000396 698.6501620002091 700.4301960002631 700.6607189998031 703.2160379998386 708.16155599989 712.3574829995632 715.3674149997532 720.7213160004467 721.1922979997471 734.4215150000528 738.6344799995422 769.2796480003744
Open Search Page TTI Baseline
Mean: 596.738 ms
Stdev: 17.849 ms (3.0%)
Runs: 566.177938000299 566.4675289997831 566.7418619999662 572.1841230001301 582.4826260004193 583.193847999908 584.6149090006948 585.131226000376 587.1527509996668 587.5491540003568 588.8603520002216 589.649902000092 590.5166009999812 590.8024089997634 592.8739830004051 592.8800059994683 595.3395589999855 595.6600759997964 600.5597739992663 600.5826829997823 604.393839999102 605.4436440002173 607.4780679997057 609.6419269992039 614.2274989997968 616.3468019999564 616.3942869994789 618.1007079994306 618.7735599996522 625.1284999996424 643.5253500007093

Current
Mean: 600.380 ms
Stdev: 20.534 ms (3.4%)
Runs: 555.474487000145 569.4584969999269 575.5961109995842 577.3892820002511 578.6652019992471 579.0782479997724 584.9118250003085 585.5296229999512 589.6092940000817 589.779542000033 592.0882980003953 592.465494999662 594.7731120008975 594.9411210007966 595.5103360004723 597.4965820005164 597.6844490002841 598.4303799998015 599.0587570006028 601.9311529994011 602.1677249995992 603.5036620004103 605.9003510000184 615.6587729994208 615.8477380005643 621.6492109997198 622.9905190002173 629.9790449999273 630.3509109998122 636.7900399994105 637.2020260002464 640.234822999686
App start regularAppStart Baseline
Mean: 0.020 ms
Stdev: 0.001 ms (6.0%)
Runs: 0.016846000216901302 0.018350999802350998 0.018432000651955605 0.018473000265657902 0.01847400050610304 0.01855500042438507 0.01896199956536293 0.019042999483644962 0.019205999560654163 0.019328000023961067 0.019531000405550003 0.019531999714672565 0.0195720000192523 0.0195720000192523 0.01969399955123663 0.019856000319123268 0.019857000559568405 0.020099999383091927 0.020100999623537064 0.020182999782264233 0.020183000713586807 0.020304000005126 0.020874000154435635 0.02107700053602457 0.021158999763429165 0.0211990000680089 0.02164699975401163 0.0217289999127388 0.022379999980330467

Current
Mean: 0.016 ms
Stdev: 0.001 ms (8.3%)
Runs: 0.01375299971550703 0.014444999396800995 0.014607999473810196 0.014852000400424004 0.01501499954611063 0.015095999464392662 0.015298999845981598 0.01537999976426363 0.015381000004708767 0.015421000309288502 0.01550300046801567 0.015910000540316105 0.016114000231027603 0.016195000149309635 0.016195000149309635 0.016234999522566795 0.016316999681293964 0.0165200000628829 0.016561000607907772 0.0166830001398921 0.016846000216901302 0.017007999122142792 0.01700899936258793 0.017048999667167664 0.017537999898195267 0.01757900044322014 0.018920999951660633 0.019286999478936195 0.01928700041025877
App start nativeLaunch Baseline
Mean: 19.571 ms
Stdev: 1.348 ms (6.9%)
Runs: 17 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 21 21 21 22 22 22 22

Current
Mean: 19.567 ms
Stdev: 1.726 ms (8.8%)
Runs: 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 20 20 21 22 22 22 23 23 23
App start runJsBundle Baseline
Mean: 197.750 ms
Stdev: 24.149 ms (12.2%)
Runs: 162 167 168 170 171 172 172 176 181 183 186 186 187 190 191 192 194 195 199 200 202 202 212 214 216 222 224 225 229 237 246 257

Current
Mean: 192.469 ms
Stdev: 18.537 ms (9.6%)
Runs: 162 164 166 174 174 175 176 177 177 181 183 184 185 187 187 187 187 189 190 194 197 199 203 209 211 214 215 217 218 224 225 228

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @mountiny in version: 1.2.55-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @AndrewGable in version: 1.2.55-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants