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

[No QA] Fix chatReportID prop type errors for IOU settlement #13783

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

neil-marcellini
Copy link
Contributor

Details

We were casting the string chatReportID to a Number, but then expecting it to be a string. I'm fixing that here and some JSDoc comments.

Fixed Issues

$ #13591
PROPOSAL: GH_LINK_ISSUE(COMMENT)

Tests

  1. With an account A, request money from account B
  2. Log in as account B and go to the chat with the request
  3. Click on the IOU request to open the details page
  4. Open the console and verify that there are no errors
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

No QA

  • 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

I have only included a video testing on web, since prop type error fixes are platform independent.

Web
Screen.Recording.2022-12-21.at.3.23.24.PM.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@neil-marcellini neil-marcellini requested a review from a team as a code owner December 21, 2022 23:26
@neil-marcellini neil-marcellini self-assigned this Dec 21, 2022
@melvin-bot melvin-bot bot requested review from grgia and sobitneupane and removed request for a team December 21, 2022 23:27
@melvin-bot
Copy link

melvin-bot bot commented Dec 21, 2022

@sobitneupane @grgia 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]

Copy link
Contributor

@grgia grgia left a comment

Choose a reason for hiding this comment

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

Looks good! Happy you got this one figured out

@sobitneupane
Copy link
Contributor

Seen below console warning once in android. But I cannot reproduce it again.

Screenshot 2022-12-22 at 12 18 54

trimmed_bug.mov

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

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

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
Screen.Recording.2022-12-22.at.10.37.40.mov
Mobile Web - Chrome
Screen.Recording.2022-12-22.at.10.46.22.mov
Mobile Web - Safari
Screen.Recording.2022-12-22.at.10.52.43.mov
Desktop
Screen.Recording.2022-12-22.at.10.43.52.mov
iOS
Screen.Recording.2022-12-22.at.10.50.07.mov
Android
Screen.Recording.2022-12-22.at.12.15.35.mov

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

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

Approving this PR because #13783 (comment) console error does not look related to IOU. @neil-marcellini Can you please take a look at #13783 (comment) console warning if we want to fix this in this PR.

@neil-marcellini
Copy link
Contributor Author

Can you please take a look at #13783 (comment) console warning if we want to fix this in this PR.

Nice find, I'll look into it and put a [HOLD] on the PR until I finish investigating.

@neil-marcellini neil-marcellini changed the title [No QA] Fix chatReportID prop type errors for IOU settlement [HOLD] [No QA] Fix chatReportID prop type errors for IOU settlement Dec 22, 2022
@neil-marcellini
Copy link
Contributor Author

@sobitneupane I can't produce that prop type error so I think this is good to go.

@neil-marcellini neil-marcellini changed the title [HOLD] [No QA] Fix chatReportID prop type errors for IOU settlement [No QA] Fix chatReportID prop type errors for IOU settlement Dec 22, 2022
@neil-marcellini neil-marcellini merged commit bbec272 into main Dec 22, 2022
@neil-marcellini neil-marcellini deleted the neil-settlement-chatReportID branch December 22, 2022 22:53
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
TTI 821.009 ms → 837.020 ms (+16.011 ms, +2.0%)
runJsBundle 190.581 ms → 194.250 ms (+3.669 ms, +1.9%)
nativeLaunch 9.133 ms → 9.903 ms (+0.770 ms, +8.4%)
regularAppStart 0.015 ms → 0.016 ms (+0.001 ms, +9.8%)
Show details
Name Duration
TTI Baseline
Mean: 821.009 ms
Stdev: 42.358 ms (5.2%)
Runs: 758.3440049998462 766.94950600015 772.0558540001512 783.1425760001875 785.2564550000243 785.6047279997729 788.1389979999512 790.025812999811 793.140285000205 794.393635999877 795.7167859999463 801.742599000223 805.4272230002098 806.7069410001859 807.4583800002001 808.9721659999341 809.4287479999475 811.1853559999727 812.7222919999622 813.4135119998828 829.4693970000371 842.5223840000108 845.5469630002044 846.0010420000181 852.0575290000997 856.9858679999597 875.3670080001466 877.9022300001234 878.1241350001656 923.4319600001909 934.0354619999416

Current
Mean: 837.020 ms
Stdev: 38.098 ms (4.6%)
Runs: 764.8745989999734 767.434315000195 771.9747029999271 773.3050210000947 796.9964470001869 802.8052750001661 805.5152429998852 819.4514750000089 820.4078700002283 820.602611000184 822.8564659999683 828.9034620001912 830.2377840001136 831.8081319998018 837.4108020002022 841.5802230001427 842.1953059998341 844.2707469998859 847.0097670000978 849.5029870001599 850.6982860001735 856.1920859999955 860.2972789998166 861.1732580000535 863.0792379998602 864.7597750001587 871.1386319999583 878.7278629997745 890.8221399998292 914.1506980000995 917.443221999798
runJsBundle Baseline
Mean: 190.581 ms
Stdev: 23.195 ms (12.2%)
Runs: 155 160 162 166 169 169 171 172 173 177 177 178 178 179 184 188 191 192 193 195 195 196 202 206 209 210 221 222 237 239 242

Current
Mean: 194.250 ms
Stdev: 19.871 ms (10.2%)
Runs: 162 169 170 170 172 174 176 180 180 182 184 185 185 186 187 190 195 196 197 198 201 202 204 204 206 208 210 213 214 237 237 242
nativeLaunch Baseline
Mean: 9.133 ms
Stdev: 0.846 ms (9.3%)
Runs: 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11

Current
Mean: 9.903 ms
Stdev: 1.990 ms (20.1%)
Runs: 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 13 13 15 15
regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.001 ms (6.7%)
Runs: 0.012654999736696482 0.013143000192940235 0.013224000111222267 0.013345999643206596 0.013631000183522701 0.013753000181168318 0.01383400009945035 0.013875999953597784 0.0139979999512434 0.014037999790161848 0.014078000094741583 0.014119000174105167 0.014120000414550304 0.014241000171750784 0.01444500032812357 0.014485999941825867 0.014566999860107899 0.014649000018835068 0.0147299999371171 0.014770000241696835 0.014891999773681164 0.014932999853044748 0.014932999853044748 0.015137000009417534 0.015422000084072351 0.015503000002354383 0.015503000002354383 0.015910000074654818 0.01615400006994605 0.016193999908864498 0.016439000144600868 0.016560000367462635

Current
Mean: 0.016 ms
Stdev: 0.001 ms (8.6%)
Runs: 0.014241999946534634 0.014403999783098698 0.014444999862462282 0.014485999941825867 0.014566999860107899 0.014566999860107899 0.014566999860107899 0.014851000159978867 0.014973999932408333 0.01501399977132678 0.015178000088781118 0.0152580002322793 0.015300000086426735 0.015542999841272831 0.015583999920636415 0.015705999918282032 0.015786999836564064 0.016195000149309635 0.016316000372171402 0.01643799990415573 0.0165200000628829 0.016601999755948782 0.016642000060528517 0.017375000286847353 0.0174150001257658 0.017577999737113714 0.017700000200420618 0.01778100011870265 0.017821999732404947 0.018554999958723783 0.0195720000192523

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @neil-marcellini in version: 1.2.44-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.44-0 🚀

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

@sobitneupane
Copy link
Contributor

PR was deployed 2 weeks ago. Payment is due for C+ review.

cc: @neil-marcellini @grgia

@sobitneupane
Copy link
Contributor

@neil-marcellini @grgia Can you please help me with the payment. The linked issue is locked.

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.

4 participants