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

Make canEditReportAction return false for deleted actions #15545

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Feb 28, 2023

Details

Fixed Issues

$ #15477

Tests

  1. Send two messages in a chat
  2. Press ArrowUp, then delete the whole message.
  3. Wait a few seconds (to make sure the deletion is finalized)
  4. Press ArrowUp
  5. Verify that the first message you sent in step 1 is brought up for editing.
  • Verify that no errors appear in the JS console

Offline tests

  1. Send two messages in a chat.
  2. Press ArrowUp, then delete the whole message.
  3. Press ArrowUp
  4. Verify that the first message you sent in step 1 is brought up for editing.

QA Steps

Same as tests and offline 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
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Web.mov
WebOffline.mov
Mobile Web - Chrome

n/a – no arrow keys

Mobile Web - Safari

n/a – no arrow keys

Desktop
Desktop.mov
DesktopOffline.mov
iOS

n/a – no arrow keys

Android

n/a – no arrow keys

@roryabraham roryabraham self-assigned this Feb 28, 2023
@roryabraham roryabraham marked this pull request as ready for review February 28, 2023 02:38
@roryabraham roryabraham requested a review from a team as a code owner February 28, 2023 02:38
@melvin-bot melvin-bot bot requested review from joelbettner and rushatgabhane and removed request for a team February 28, 2023 02:39
@MelvinBot
Copy link

@rushatgabhane @joelbettner 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]

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 1, 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.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • 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.2023-03-01.at.10.58.07.AM.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2023-03-01.at.11.04.02.AM.mov
Screen.Recording.2023-03-01.at.11.03.11.AM.mov
iOS
Android

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

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

LGTM!

@roryabraham roryabraham merged commit f97b385 into main Mar 1, 2023
@roryabraham roryabraham deleted the Rory-FixQuickEditWithDeletedActionsInTheWay branch March 1, 2023 07:50
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
Open Search Page TTI 613.938 ms → 668.771 ms (+54.833 ms, +8.9%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 613.938 ms
Stdev: 25.848 ms (4.2%)
Runs: 570.962483999785 572.0632729995996 577.2709149997681 580.0358479996212 581.9034839998931 582.911579999607 590.6376960002817 592.8795570000075 594.8430590000935 595.2369800000452 597.3858640003018 606.5941159999929 607.6329749999568 608.9489339999855 609.7830000002868 613.5386159997433 614.8380950000137 615.060344000347 624.007161999587 624.1856689997949 626.7820640001446 628.0930169997737 628.2099199998192 628.2738040001132 632.5141199999489 634.5332029997371 635.412313000299 638.5472409999929 639.1290699997917 659.9019380002283 666.7248539999127 667.1674000001512

Current
Mean: 668.771 ms
Stdev: 16.118 ms (2.4%)
Runs: 633.3850099998526 643.8826909996569 644.1763509996235 647.1256919996813 648.1916910000145 651.4579260000028 652.115967000369 657.8259280002676 658.5284839998931 659.5624599996954 659.8272710000165 662.6218270002864 663.0963139999658 666.0738129997626 666.3635660000145 670.8221029997803 670.9647619999014 672.1982829999179 673.5144050000235 677.1600350001827 677.9176030000672 678.0983889997005 678.3231609999202 680.019125000108 680.332438999787 682.9363200003281 683.9003909998573 684.3449709997512 689.0360920000821 692.5954189999029 696.716512999963 697.5451660002582

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 696.208 ms → 716.296 ms (+20.088 ms, +2.9%)
App start runJsBundle 192.563 ms → 200.125 ms (+7.563 ms, +3.9%)
App start nativeLaunch 18.968 ms → 20.138 ms (+1.170 ms, +6.2%)
App start regularAppStart 0.014 ms → 0.014 ms (+0.000 ms, +3.1%)
Show details
Name Duration
App start TTI Baseline
Mean: 696.208 ms
Stdev: 24.735 ms (3.6%)
Runs: 645.3385479999706 649.1740979999304 656.8693140000105 665.3475250001065 669.8703330000862 672.5632070000283 675.9399720001966 677.2576859998517 679.5052519999444 679.6827580002137 682.3167989999056 685.3785430002026 690.680815000087 692.4227240001783 692.754521000199 694.9960750001483 695.9407239998691 700.3041920000687 700.5970129999332 706.5490390001796 710.1339500001632 710.5161709999666 711.7627449999563 714.5497369999066 716.1458569997922 720.3571770000271 722.5903440001421 724.429446999915 729.0043600001372 729.6885279999115 732.823243000079 743.162740000058

Current
Mean: 716.296 ms
Stdev: 31.070 ms (4.3%)
Runs: 668.6922969999723 672.9860169999301 678.6604459998198 684.224721999839 689.0669680000283 691.3674920001067 698.357032999862 699.2808530000038 699.7289490001276 700.7951650000177 701.4151289998554 701.4372689998709 701.7746600001119 702.4219390000217 703.092476000078 703.5295139998198 706.0491639999673 708.6480339998379 717.2178440000862 719.6632539997809 720.2521779998206 722.9032879997976 727.1225649998523 733.8521730001085 742.5790269998834 743.4286540001631 757.3626009998843 758.808383999858 767.0455470001325 783.4816239997745 799.9421089999378
App start runJsBundle Baseline
Mean: 192.563 ms
Stdev: 18.601 ms (9.7%)
Runs: 167 169 170 171 171 172 174 176 178 180 184 184 185 187 189 189 190 192 192 194 199 201 203 205 208 208 208 213 214 216 223 250

Current
Mean: 200.125 ms
Stdev: 21.740 ms (10.9%)
Runs: 167 173 175 177 178 180 180 184 185 186 186 187 189 193 194 195 195 197 197 200 204 206 207 209 211 225 229 231 233 241 244 246
App start nativeLaunch Baseline
Mean: 18.968 ms
Stdev: 1.121 ms (5.9%)
Runs: 17 17 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 21 22

Current
Mean: 20.138 ms
Stdev: 1.776 ms (8.8%)
Runs: 17 18 18 18 18 19 19 19 19 19 19 19 19 20 20 20 21 21 21 21 21 21 21 21 22 22 23 23 25
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (7.3%)
Runs: 0.012126000132411718 0.012451999820768833 0.012532999739050865 0.012653999961912632 0.012654999736696482 0.012654999736696482 0.012695000041276217 0.012776999734342098 0.013020999729633331 0.013143000192940235 0.013183999806642532 0.013224999886006117 0.013265000190585852 0.013265000190585852 0.013305999804288149 0.013305999804288149 0.013306000269949436 0.013386999722570181 0.013428000267595053 0.013672000262886286 0.01375299971550703 0.013915999792516232 0.01399700017645955 0.014077999629080296 0.014322999864816666 0.014404000248759985 0.01444500032812357 0.014851999934762716 0.014892000239342451 0.015583999920636415 0.01599099999293685 0.016112999990582466

Current
Mean: 0.014 ms
Stdev: 0.001 ms (5.2%)
Runs: 0.01310200011357665 0.013183000031858683 0.013305999804288149 0.013386999722570181 0.013387999963015318 0.013427000027149916 0.0134680001065135 0.01355000026524067 0.01355000026524067 0.013590000104159117 0.013671999797224998 0.013712000101804733 0.013712000101804733 0.013794000260531902 0.013794000260531902 0.013835000339895487 0.013915999792516232 0.013955999631434679 0.0139979999512434 0.014037999790161848 0.014037999790161848 0.014160000253468752 0.014322999864816666 0.014485999941825867 0.014688999857753515 0.014770000241696835 0.014851999934762716 0.015176999848335981 0.015461999922990799 0.015705999918282032 0.016032000072300434

@github-actions github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker.

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/roryabraham in version: 1.2.78-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.78-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
DeployBlockerCash This issue or pull request should block deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants