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

Pass createdReportActionID to OpenReport #13324

Merged
merged 21 commits into from
Jan 12, 2023
Merged

Conversation

flodnv
Copy link
Contributor

@flodnv flodnv commented Dec 5, 2022

HOLD on https://github.com/Expensify/Expensify/issues/240916
HOLD till https://github.com/Expensify/Auth/pull/7305 is live.

Details

Fixed Issues

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

Tests

  1. Create a new group chat, verify that:
    • The generated reportActionID gets inserted into the database as a CREATED action.
    • It does not stay "unread" (it gets marked as read automatically)
    • After sending the first message, it does not stay "unread"
  2. Create a new 1:1 chat, verify that:
    • The generated reportActionID gets inserted into the database as a CREATED action.
    • It does not stay "unread" (it gets marked as read automatically)
    • After sending the first message, it does not stay "unread"
  • Verify that no errors appear in the JS console

Offline tests

  1. When offline, create a new group chat
  2. Come back online, verify that it does not stay "unread" (it gets marked as read automatically)
  3. When offline, create a new 1:1 chat, verify that it does not stay "unread" (it gets marked as read automatically)
  4. Come back online, verify that it does not stay "unread" (it gets marked as read automatically)

QA Steps

  1. Create a new group chat, verify that:
    • It does not stay "unread" (it gets marked as read automatically)
    • After sending the first message, it does not stay "unread"
  2. Create a new 1:1 chat, verify that:
    • It does not stay "unread" (it gets marked as read automatically)
    • After sending the first message, it does not stay "unread"
  • 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
Screen.Recording.2023-01-06.at.1.42.41.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-01-06.at.2.15.28.PM.mov
Mobile Web - Safari
Screen.Recording.2023-01-06.at.2.03.40.PM.mov
Desktop
Screen.Recording.2023-01-06.at.1.46.26.PM.mov
iOS
Screen.Recording.2023-01-06.at.2.00.34.PM.mov
Android
Screen.Recording.2023-01-06.at.2.12.15.PM.mov

@flodnv flodnv requested a review from a team as a code owner December 5, 2022 15:50
@flodnv flodnv self-assigned this Dec 5, 2022
@melvin-bot melvin-bot bot requested review from eVoloshchak and puneetlath and removed request for a team December 5, 2022 15:51
@melvin-bot
Copy link

melvin-bot bot commented Dec 5, 2022

@eVoloshchak @puneetlath 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]

@flodnv
Copy link
Contributor Author

flodnv commented Dec 5, 2022

@roryabraham I am submitting this for early feedback to get your thoughts on a couple of things. I tested this and it's working, with the caveat that I think there's a bug on main (but I am not sure)

src/libs/actions/Report.js Outdated Show resolved Hide resolved
@flodnv flodnv removed the request for review from puneetlath December 5, 2022 15:52
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, but if this is true then we should start keying by the optimisticReportActionID here

src/libs/actions/Report.js Outdated Show resolved Hide resolved
@flodnv
Copy link
Contributor Author

flodnv commented Dec 6, 2022

Can you please help me with my comment above? I am quite lost, at least until someone helps me: https://expensify.slack.com/archives/C03TQ48KC/p1670345544646399

src/libs/actions/Report.js Outdated Show resolved Hide resolved
src/libs/actions/Report.js Outdated Show resolved Hide resolved
src/libs/actions/Report.js Outdated Show resolved Hide resolved
src/libs/actions/Report.js Outdated Show resolved Hide resolved
src/libs/ReportUtils.js Outdated Show resolved Hide resolved
@flodnv flodnv changed the title Pass createdReportActionID to OpenReport [HOLD https://github.com/Expensify/Expensify/issues/240916] Pass createdReportActionID to OpenReport Dec 8, 2022
thienlnam
thienlnam previously approved these changes Dec 10, 2022
src/libs/actions/Report.js Outdated Show resolved Hide resolved
@thienlnam
Copy link
Contributor

Reviews addressed, this is ready to be tested / merged cc @roryabraham @puneetlath @mountiny

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.

@thienlnam code looks good to me, thanks for persistent work on this one. I will add test/ video in the morning if it wont be merged by then!

Copy link
Contributor Author

@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.

Retested, all good, let's get this merged :shipit:

@mananjadhav
Copy link
Collaborator

@flodnv I had done some initial review, but didn't get a chance to look at it again. I did check the code today as well. Do you want me to complete the C+ checklist here?

@mountiny mountiny removed the request for review from eVoloshchak January 12, 2023 14:00
@mountiny
Copy link
Contributor

@mananjadhav if you have time for it right now, please do so!

I will go through the testing soon otherwise.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jan 12, 2023

Okay code I did review, I'll cover the testing in 1-2 hours. Thank you for your patience.

@mountiny mountiny dismissed roryabraham’s stale review January 12, 2023 15:04

Requested changes have been addressed

@mountiny
Copy link
Contributor

@mananjadhav Thanks, let us know if you have some issues, or delays!

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jan 12, 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
web-report-action-id.mov
Mobile Web - Chrome
mweb-chrome-report-action-id.mov
Mobile Web - Safari
mweb-safari-report-action-id.mov
Desktop
desktop-report-action-id.mov
iOS
ios-report-action-id.mov
Android https://user-images.githubusercontent.com/3069065/212135278-5caaf4fb-ec0d-44ac-990f-70aecc2c1487.mov

@flodnv @mountiny I've tested this and it works fine. I've also verified this issue while testing.

Though I'd like to highlight an unrelated issue which exists when I moved from offline to online state. The order of the messages change and the first message that I sent shows twice. @mountiny It would be helpful if you can also test this bit here.

@flodnv
Copy link
Contributor Author

flodnv commented Jan 12, 2023

Yeah, I've seen this too and it's unrelated to this PR. We'll take care of it in that issue you linked. Thanks for your help @mananjadhav

@flodnv flodnv dismissed neil-marcellini’s stale review January 12, 2023 17:54

Neil is ooo, requested changes have been made and approved

@flodnv flodnv merged commit 413c1e6 into main Jan 12, 2023
@flodnv flodnv deleted the flo_createdReportActionID branch January 12, 2023 17:54
@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
App start TTI 697.297 ms → 709.919 ms (+12.622 ms, +1.8%)
App start runJsBundle 197.031 ms → 197.500 ms (+0.469 ms, ±0.0%)
App start regularAppStart 0.021 ms → 0.022 ms (+0.001 ms, +4.2%)
Open Search Page TTI 615.068 ms → 615.055 ms (-0.013 ms, ±0.0%)
App start nativeLaunch 20.207 ms → 19.621 ms (-0.586 ms, -2.9%)
Show details
Name Duration
App start TTI Baseline
Mean: 697.297 ms
Stdev: 33.194 ms (4.8%)
Runs: 618.6739860000089 646.3659059999045 652.8581189999823 656.1826579999179 664.2891740000341 667.717433999991 670.118696999969 673.3621660000645 674.5921070000622 677.266190999886 684.6411139999982 686.4533840001095 687.8143629999831 688.1219989999663 689.675169999944 691.3569410000928 705.2033500000834 705.8516410000157 709.4299439999741 709.4301299999934 710.406621000031 712.8818779999856 714.0002979999408 715.3749879999086 719.2491639999207 723.1905040000565 724.641324999975 729.0950549999252 732.6660909999628 734.2888569999486 749.5296390000731 788.7847919999622

Current
Mean: 709.919 ms
Stdev: 23.952 ms (3.4%)
Runs: 672.9259059999604 682.103063999908 684.990322999889 687.7426140001044 688.0338179999962 689.194897999987 689.790740000084 690.7054959998932 690.7479220000096 697.8235520001035 698.86183300009 701.2076270000543 703.4809479999822 705.0998680000193 706.4714379999787 709.1293649999425 709.3751519999932 711.9757890000474 715.7553300000727 716.2140510000754 717.9465830000117 720.1683529999573 721.7478110000957 724.1287489999086 724.1592840000521 726.2022840001155 766.9136620000936 767.378866000101 767.3860619999468
App start runJsBundle Baseline
Mean: 197.031 ms
Stdev: 20.335 ms (10.3%)
Runs: 169 173 175 175 176 176 177 180 181 182 184 185 187 190 191 194 195 197 197 199 200 203 210 210 214 215 217 218 219 222 233 261

Current
Mean: 197.500 ms
Stdev: 15.134 ms (7.7%)
Runs: 167 176 179 180 181 185 185 185 189 191 192 192 194 194 195 195 196 199 201 201 203 204 205 206 213 219 221 223 226 228
App start regularAppStart Baseline
Mean: 0.021 ms
Stdev: 0.001 ms (5.0%)
Runs: 0.019164999946951866 0.019164999946951866 0.019247000105679035 0.019286999944597483 0.019613000098615885 0.019652999937534332 0.019653999945148826 0.019694000016897917 0.020262999925762415 0.02050799992866814 0.02050799992866814 0.020751999923959374 0.020791999995708466 0.02079300000332296 0.020955999847501516 0.021078000077977777 0.021118000149726868 0.021200000075623393 0.02123999991454184 0.02123999991454184 0.02123999991454184 0.02140299999155104 0.021566000068560243 0.022012999979779124 0.022012999979779124 0.022135999985039234 0.022665000054985285 0.022745999973267317

Current
Mean: 0.022 ms
Stdev: 0.001 ms (5.9%)
Runs: 0.019286999944597483 0.019491000100970268 0.0195720000192523 0.020142000168561935 0.020304000005126 0.0204670000821352 0.020549000008031726 0.020588999846950173 0.02083300007507205 0.020954999839887023 0.020955000072717667 0.021117999916896224 0.021646999986842275 0.02168800006620586 0.02168800006620586 0.021810000063851476 0.022012999979779124 0.02213499997742474 0.02217599982395768 0.02217599982395768 0.022176000056788325 0.02221700013615191 0.022256999975070357 0.02242000005207956 0.022745999973267317 0.02294900012202561 0.02315300004556775 0.023884999798610806 0.023965999949723482 0.024130000034347177
Open Search Page TTI Baseline
Mean: 615.068 ms
Stdev: 20.483 ms (3.3%)
Runs: 586.4519859999418 589.328125 589.6111659999005 590.6929529998451 592.6620279999916 592.6667889999226 593.0336910001934 597.8062750000972 599.8136799999047 601.1730140000582 603.2795819998719 605.5948489999864 605.9739579998422 606.3055429998785 606.4563809998799 608.4589039999992 608.8501389999874 619.7555339999963 621.5752360001206 622.8675540001132 624.5142420001794 625.0153400001582 626.3206789998803 628.4591890000738 629.3228760000784 630.5018720000517 631.5062669999897 632.3146979999729 636.2159019999672 647.3216959999409 662.1606039998587 666.1682540001348

Current
Mean: 615.055 ms
Stdev: 20.508 ms (3.3%)
Runs: 586.7819819999859 587.4854739999864 588.9431570000015 592.7889000000432 596.2424729997292 599.1844069999643 599.6625570002943 599.7656660000794 599.7731130002066 600.9178470000625 601.6011149999686 601.6348069999367 601.9297290001996 602.1591799999587 602.6090910001658 604.5146080004051 609.8142099999823 611.1774089997634 611.1923010000028 617.6143390000798 618.1954339998774 625.0825189999305 625.7608649998438 626.5139979999512 629.1797690000385 629.8164470000193 630.3352050001267 637.8031419999897 639.917156000156 645.4108480000868 650.8538420000114 657.8020430000033 664.3402510001324
App start nativeLaunch Baseline
Mean: 20.207 ms
Stdev: 1.669 ms (8.3%)
Runs: 17 17 18 19 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 22 23 24 24

Current
Mean: 19.621 ms
Stdev: 1.400 ms (7.1%)
Runs: 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 21 21 21 21 22 22 24

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @flodnv in version: 1.2.54-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @AndrewGable in version: 1.2.54-2 🚀

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

@mananjadhav
Copy link
Collaborator

@flodnv @mountiny This is deployed on production for 7 days. Can someone please help me with the payout here?

@puneetlath
Copy link
Contributor

Sent you a hiring offer @mananjadhav.

@mananjadhav
Copy link
Collaborator

Accepted @puneetlath

@puneetlath
Copy link
Contributor

Paid! Thanks again for the help.

@mananjadhav
Copy link
Collaborator

Received. Thank you for the prompt action!

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.

10 participants