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

Update ShortLivedToken naming convention #13675

Merged
merged 2 commits into from
Dec 21, 2022
Merged

Conversation

NikkiWines
Copy link
Contributor

@NikkiWines NikkiWines commented Dec 16, 2022

Details

Updating naming conventions for consistency.

cc: @Beamanator as we discussed this here

Fixed Issues

$ N/A discussed in #13456

Tests

  1. Log into an account on oldDot and create a new Free policy
  2. Confirm you're automatically logged into newDot as that user
  3. Log out of the account on NewDot
  4. Back in OldDot, click on the name of the free policy you created in step 1
  5. Confirm you're logged back into newDot and that you land on the workspace page
  6. Navigate to the /pricing page on oldDot and selected Free
  7. Confirm you're logged back into newDot and that you land on the workspace page of a new workspace
  • Verify that no errors appear in the JS console

Offline tests

N/A This action can only be taken while online. If you try this while offline in oldDot you get the following error:
image

QA Steps

  1. Log into an account on oldDot and create a new Free policy
  2. Confirm you're automatically logged into newDot as that user
  3. Log out of the account on NewDot
  4. Back in OldDot, click on the name of the free policy you created in step 1
  5. Confirm you're logged back into newDot and that you land on the workspace page
  6. Navigate to the /pricing page on oldDot and selected Free
  7. Confirm you're logged back into newDot and that you land on the workspace page of a new workspace
  • 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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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

AFAIK this can only be tested on web. The last PR that updated this logic (#8855) doesn't appear to have platform-specific tests.

Web

Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@NikkiWines NikkiWines changed the title [HOLD] Update shortlivedtoken naming convention [HOLD] Update ShortLivedToken naming convention Dec 16, 2022
@NikkiWines NikkiWines self-assigned this Dec 16, 2022
Copy link
Contributor

@Beamanator Beamanator left a comment

Choose a reason for hiding this comment

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

Noice 👍 👍

@NikkiWines
Copy link
Contributor Author

Web-E PR is on staging so gonna mark this as ready for review so we can merge it once the Web-E PR goes to prod.

@NikkiWines NikkiWines marked this pull request as ready for review December 20, 2022 16:27
@NikkiWines NikkiWines requested a review from a team as a code owner December 20, 2022 16:27
@melvin-bot melvin-bot bot requested review from deetergp and removed request for a team December 20, 2022 16:27
@melvin-bot
Copy link

melvin-bot bot commented Dec 20, 2022

@deetergp Please 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]

@deetergp
Copy link
Contributor

deetergp commented Dec 20, 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

2022-12-20_14-53-14 (2)

Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@Beamanator
Copy link
Contributor

@NikkiWines NikkiWines changed the title [HOLD] Update ShortLivedToken naming convention Update ShortLivedToken naming convention Dec 21, 2022
@NikkiWines
Copy link
Contributor Author

Off hold now that https://github.com/Expensify/Web-Expensify/pull/35857 is on prod!

@Beamanator Beamanator merged commit 2585cef into main Dec 21, 2022
@Beamanator Beamanator deleted the nikki-update-shortlivedtoken branch December 21, 2022 15:44
@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 786.983 ms → 826.026 ms (+39.043 ms, +5.0%)
runJsBundle 190.594 ms → 196.750 ms (+6.156 ms, +3.2%)
regularAppStart 0.013 ms → 0.014 ms (+0.001 ms, +4.1%)
nativeLaunch 10.125 ms → 10.069 ms (-0.056 ms, -0.6%)
Show details
Name Duration
TTI Baseline
Mean: 786.983 ms
Stdev: 27.094 ms (3.4%)
Runs: 740.3122910000384 743.8746050000191 745.1665760017931 754.2259129993618 763.4743270017207 764.7923710010946 769.9361139982939 771.5452239997685 773.0759669989347 774.4797660000622 775.8636579997838 776.395799998194 782.64516299963 783.6691620014608 786.4318530000746 787.8528029993176 790.9869219996035 791.1596320010722 795.6886209994555 796.1637299992144 808.0440349988639 810.9128240011632 810.9644210003316 812.4135930016637 814.2222770005465 814.7612739987671 842.7806570008397 853.6759180016816

Current
Mean: 826.026 ms
Stdev: 37.450 ms (4.5%)
Runs: 765.4738710001111 765.63986299932 774.3575589992106 783.3882139995694 786.7441690005362 786.9175990000367 790.510627001524 794.7044790014625 799.6714709997177 803.8177540004253 806.1195480003953 809.4368809983134 813.4132639989257 814.8437549993396 818.5474519990385 821.3499520011246 822.379050001502 828.896999001503 830.880977999419 840.7697140015662 841.8883190006018 848.6616710014641 854.039319999516 854.4376400001347 856.2980530001223 865.0483830012381 871.8099149987102 872.9811200015247 873.5664299987257 902.50793299824 907.7070400007069
runJsBundle Baseline
Mean: 190.594 ms
Stdev: 24.828 ms (13.0%)
Runs: 155 158 161 162 162 168 169 172 175 176 176 176 177 178 178 182 183 187 188 193 198 203 207 208 213 215 216 218 226 232 234 253

Current
Mean: 196.750 ms
Stdev: 24.627 ms (12.5%)
Runs: 162 163 165 168 172 172 176 177 178 178 183 185 186 188 189 190 192 196 197 199 205 211 212 215 215 216 217 222 226 226 249 266
regularAppStart Baseline
Mean: 0.013 ms
Stdev: 0.001 ms (5.9%)
Runs: 0.01228800043463707 0.012289002537727356 0.012450996786355972 0.01269499957561493 0.012736000120639801 0.012776996940374374 0.012777000665664673 0.012816999107599258 0.01285799965262413 0.01285799965262413 0.012940000742673874 0.01297999918460846 0.013020001351833344 0.013183001428842545 0.013183001428842545 0.013265002518892288 0.013345997780561447 0.013346001505851746 0.013387002050876617 0.013387002050876617 0.013427000492811203 0.013468001037836075 0.013630997389554977 0.013875000178813934 0.013875000178813934 0.01407800242304802 0.014607999473810196 0.014688998460769653 0.015135999768972397 0.015583999454975128

Current
Mean: 0.014 ms
Stdev: 0.001 ms (6.1%)
Runs: 0.012206997722387314 0.012369997799396515 0.012653999030590057 0.013142000883817673 0.013182997703552246 0.013183001428842545 0.013508997857570648 0.013590000569820404 0.013590998947620392 0.013630997389554977 0.013631001114845276 0.013712000101804733 0.013712998479604721 0.013753000646829605 0.013793997466564178 0.013875000178813934 0.013875000178813934 0.013997998088598251 0.014159999787807465 0.014200001955032349 0.014242000877857208 0.014281999319791794 0.01428300142288208 0.014444999396800995 0.01469000056385994 0.014770999550819397 0.015420999377965927 0.01574699953198433 0.015827998518943787
nativeLaunch Baseline
Mean: 10.125 ms
Stdev: 1.867 ms (18.4%)
Runs: 8 8 8 8 8 8 8 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 11 11 11 12 12 14 14 14 14

Current
Mean: 10.069 ms
Stdev: 2.116 ms (21.0%)
Runs: 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 14 17

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @Beamanator in version: 1.2.43-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.43-1 🚀

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

@alex-mechler
Copy link
Contributor

This caused #13894. The old mobile app still uses shortLivedToken parameter when transitioning to NewDot. Since we were no longer checked for that parameter, the old mobile app was unable to transition to newdot

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