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

Revert "Use Onyx.clear to preserve state when logging out" #13758

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

yuwenmemon
Copy link
Contributor

@yuwenmemon yuwenmemon commented Dec 21, 2022

@aldo-expensify please review

Reverts #13384

Fixed Issues

$ #13753
$ #13755

Tests

  1. Launch the app from a clean build
  2. Log in with any account
  3. Log out
  4. Log in with another account

Offline tests

N/A

QA Steps

Same as above

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
Kapture.2022-12-21.at.10.02.32.mp4
Mobile Web - Chrome
Kapture.2022-12-21.at.10.12.28.mp4
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.-.2022-12-21.at.11.03.47.mp4
Desktop
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2022-12-21.at.11.00.40.mp4
Android
Kapture.2022-12-21.at.10.11.36.mp4

@yuwenmemon yuwenmemon self-assigned this Dec 21, 2022
@yuwenmemon yuwenmemon marked this pull request as ready for review December 21, 2022 17:56
@yuwenmemon yuwenmemon requested a review from a team as a code owner December 21, 2022 17:56
@melvin-bot melvin-bot bot requested review from aimane-chnaif and cristipaval and removed request for a team December 21, 2022 17:56
@melvin-bot
Copy link

melvin-bot bot commented Dec 21, 2022

@cristipaval @aimane-chnaif 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

@aldo-expensify aldo-expensify left a comment

Choose a reason for hiding this comment

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

Worked for me. Tested in IOS

@github-actions
Copy link
Contributor

⚠️ ⚠️ Heads up! This pull request has the CP Staging label ⚠️ ⚠️
If you applied the CP Staging label before the PR was merged, the PR will be be immediately deployed to staging even if the open StagingDeployCash deploy checklist is locked.
However if you applied the CP Staging after the PR was merged it's possible it won't be CP'ed automatically. If you need it to be CP'ed to staging, tag a member of @Expensify/mobile-deployers to CP it manually, otherwise you can wait for it to go out with the next deploy.

@cristipaval
Copy link
Contributor

cristipaval commented Dec 21, 2022

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.mov
Mobile Web - Chrome
mobile.chrome.mov
Mobile Web - Safari
mobile.safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov

@melvin-bot
Copy link

melvin-bot bot commented Dec 21, 2022

❗ Please, do not use Github auto-linking keywords such as these: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved.

For more details, see the Contributing Guidelines, specifically Submit your pull request for a final review 📖.

@yuwenmemon
Copy link
Contributor Author

STFU Melvin, fine.

@cristipaval cristipaval merged commit 2fe025b into main Dec 21, 2022
@cristipaval cristipaval deleted the revert-13384-yuwen-preserveOffline branch December 21, 2022 18:29
OSBotify pushed a commit that referenced this pull request Dec 21, 2022
…ffline

Revert "Use Onyx.clear to preserve state when logging out"

(cherry picked from commit 2fe025b)
OSBotify added a commit that referenced this pull request Dec 21, 2022
@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
nativeLaunch 9.214 ms → 9.677 ms (+0.463 ms, +5.0%)
regularAppStart 0.014 ms → 0.014 ms (+0.001 ms, +4.2%)
TTI 802.054 ms → 797.802 ms (-4.252 ms, -0.5%)
runJsBundle 193.677 ms → 184.387 ms (-9.290 ms, -4.8%)
Show details
Name Duration
nativeLaunch Baseline
Mean: 9.214 ms
Stdev: 0.860 ms (9.3%)
Runs: 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 11 11

Current
Mean: 9.677 ms
Stdev: 1.511 ms (15.6%)
Runs: 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 11 11 12 12 13 13 13
regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (7.2%)
Runs: 0.012165999971330166 0.012409999966621399 0.012411000207066536 0.012695999816060066 0.012776000425219536 0.012776999734342098 0.012980000115931034 0.013101999647915363 0.013101999647915363 0.013143000192940235 0.013224000111222267 0.013265000656247139 0.013306000269949436 0.013346999883651733 0.013388000428676605 0.01342800073325634 0.01387499924749136 0.013915999792516232 0.014079000800848007 0.014200999401509762 0.01448499970138073 0.014566999860107899 0.014607999473810196 0.0147299999371171 0.014810999855399132 0.014852000400424004 0.015217999927699566 0.01521800085902214 0.015421000309288502 0.015910000540316105

Current
Mean: 0.014 ms
Stdev: 0.001 ms (8.0%)
Runs: 0.01297999918460846 0.013345999643206596 0.013346999883651733 0.013427999801933765 0.0134680001065135 0.013508999720215797 0.013549999333918095 0.013712000101804733 0.01371300034224987 0.01375299971550703 0.013794000260531902 0.013835000805556774 0.013875000178813934 0.013915999792516232 0.013915999792516232 0.014078999869525433 0.014159999787807465 0.014281999319791794 0.014403999783098698 0.014405000023543835 0.014485999941825867 0.014566999860107899 0.014689999632537365 0.014851999469101429 0.015422000549733639 0.016195000149309635 0.016235999763011932 0.016276000067591667 0.01839200034737587
TTI Baseline
Mean: 802.054 ms
Stdev: 46.690 ms (5.8%)
Runs: 738.7146840002388 748.8463220000267 760.7884970000014 760.8174019996077 760.8213670002297 764.9939440004528 767.3264920003712 767.5763229997829 767.588607000187 768.1840920001268 775.4549059998244 777.3467229995877 780.4336350001395 782.2487249998376 784.702564000152 787.2271239999682 787.57089299988 793.2161039998755 797.680596999824 798.6315729999915 800.4933470003307 810.5527980001643 813.1114220004529 819.8857180001214 846.8453409997746 848.1207510000095 863.3814479997382 870.8701320001855 896.7898420002311 898.6508149998263 924.7935920003802

Current
Mean: 797.802 ms
Stdev: 26.569 ms (3.3%)
Runs: 747.4471150003374 752.8805400002748 762.3150199996307 763.7748980000615 769.2214839998633 773.6834169998765 775.4777720002457 777.3602499999106 778.2564040003344 789.7294340003282 790.6355060003698 791.6456760000437 791.9244419997558 792.2743340004236 792.6286610001698 800.2969699995592 800.8152280002832 803.869483999908 805.1998410001397 808.9533540001139 816.9047779999673 818.3450149996206 819.1178150000051 819.5091460002586 826.3528789998963 838.901833999902 841.0262150000781 843.5963129997253 844.1084899995476
runJsBundle Baseline
Mean: 193.677 ms
Stdev: 20.394 ms (10.5%)
Runs: 161 163 166 169 170 172 176 177 179 179 180 183 186 186 186 191 193 196 197 200 203 207 213 215 218 219 219 221 225 227 227

Current
Mean: 184.387 ms
Stdev: 18.275 ms (9.9%)
Runs: 162 163 164 166 167 168 168 169 170 171 172 174 174 174 176 178 178 184 186 187 189 189 194 201 202 208 210 212 217 218 225

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by @cristipaval in version: 1.2.42-2 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @yuwenmemon in version: 1.2.42-2 🚀

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

@tgolen
Copy link
Contributor

tgolen commented Dec 29, 2022

This will need to be re-reverted once the SQLite change is deployed and once multiRemove() is implemented. This is being tracked with https://github.com/Expensify/Expensify/issues/251798

tgolen added a commit that referenced this pull request Dec 29, 2022
bernhardoj pushed a commit to bernhardoj/Expensify that referenced this pull request Jan 16, 2023
@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀

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.

5 participants