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

Also check for shortLivedToken when signing in with shortLivedAuthToken #14045

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

alex-mechler
Copy link
Contributor

@alex-mechler alex-mechler commented Jan 6, 2023

cc @NikkiWines

Fixed Issues

$ #13894
PROPOSAL: N/a

Tests

I couldn't directly test this flow locally, as I cannot build the old app locally. I tested that the flow still works by updating the parameter name in the url of an old app transition, and the following steps to confirm that existing transitions still work.

Desktop web

  1. Signed into OldDot
  2. Made a new workspace
  3. verified I was transitioned with no issues

MWeb

  1. Signed into OldDot
  2. Selected Set up my company for free
  3. Verified I was transitioned with no issue
  • Verify that no errors appear in the JS console

Offline tests

N/a, can only transition online as it logs you in

QA Steps

  1. Open the OldDot mobile app and log in with an account that has a existing workspace policy
  2. Verify the Use Staging Server switch is on
  3. Navigate to "Settings" and tap on "View all" on the policies section
  4. Tap on the "Group" tab
  5. Tap on the "Edit" button next to a Workspace
  6. Tap on the "Current Plan" option inside the workspace settings
  7. Verify that the workspace loads on NewDot with no issue
  • 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
2023-01-05_16-16-40.mp4
Mobile Web - Chrome
2023-01-05_16-27-20.mp4
Mobile Web - Safari
2023-01-05_16-13-51.mp4
Desktop

N/A We do not transition into the desktop

iOS

N/A We do not transition into the mobile apps

Android

N/A We do not transition into the mobile apps

@alex-mechler alex-mechler requested a review from a team as a code owner January 6, 2023 00:28
@alex-mechler alex-mechler self-assigned this Jan 6, 2023
@alex-mechler alex-mechler changed the title Also check for shortLivedToken when signing in with shortLivedToken Also check for shortLivedToken when signing in with shortLivedAuthToken Jan 6, 2023
@melvin-bot melvin-bot bot requested review from aimane-chnaif and stitesExpensify and removed request for a team January 6, 2023 00:28
@melvin-bot
Copy link

melvin-bot bot commented Jan 6, 2023

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

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Aside from the lint error this looks good. @alex-mechler since we're doing an oldApp release fairly soon, how do you feel about updating this in Mobile-Expensify so that we can eventually only have to check on value, not both?

@alex-mechler
Copy link
Contributor Author

Updated to fix the lint error.

@alex-mechler since we're doing an oldApp release fairly soon, how do you feel about updating this in Mobile-Expensify so that we can eventually only have to check on value, not both?

Is the new mobile release going to force people to update? If it does not, people still might be using the old version of the app, in which case we will still have to support both

@NikkiWines
Copy link
Contributor

Fair... eventually yes they will be forced to update because we will move to passwordless authentication across the board.

@alex-mechler
Copy link
Contributor Author

Fair enough, we can update it there, since we are releasing anyways. Might have to keep an eye on adoption numbers before we pull the plug on checking both, as people still signed in to the app won't have to update. It wouldn't hurt to update there, I'll get a PR up

@aimane-chnaif
Copy link
Contributor

The fix is clear to me and tests well, since I am already familiar with this while reviewing #13456

Fair... eventually yes they will be forced to update because we will move to passwordless authentication across the board.

Nevertheless, this PR should be merged to support current version of OldDot mobile app, right?
If yes, I will fill checklist and screenshots.

Copy link
Contributor

@aimane-chnaif aimane-chnaif left a comment

Choose a reason for hiding this comment

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

Should shortLivedToken be added in propTypes as well?

params: PropTypes.shape({
/** Short lived authToken to sign in a user */
shortLivedAuthToken: PropTypes.string,
/** The email of the transitioning user */
email: PropTypes.string,
}),

@NikkiWines
Copy link
Contributor

Nevertheless, this PR should be merged to support current version of OldDot mobile app, right?

Correct, this needs to be merged so that the oldApp transitions are fixed for now, as we're not quite sure yet when the next update for oldApp will be

@alex-mechler
Copy link
Contributor Author

Yup, we still do want this to support old versions of the mobile app. Added proptypes

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

:shipit:

@stitesExpensify
Copy link
Contributor

stitesExpensify commented Jan 9, 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
2023-01-09_14-40-38.mp4
Mobile Web - Chrome
2023-01-09_15-13-54.mp4
Mobile Web - Safari
2023-01-09_15-14-31.mp4
Desktop

n/a

iOS

n/a

Android

n/a

@stitesExpensify stitesExpensify merged commit 878fb22 into main Jan 9, 2023
@stitesExpensify stitesExpensify deleted the amechler-fix-old-app-transition branch January 9, 2023 22:17
@OSBotify
Copy link
Contributor

OSBotify commented Jan 9, 2023

✋ 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

github-actions bot commented Jan 9, 2023

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start nativeLaunch 10.200 ms → 19.833 ms (+9.633 ms, +94.4%) 🔴
App start runJsBundle 176.586 ms → 183.774 ms (+7.188 ms, +4.1%)
App start regularAppStart 0.014 ms → 0.021 ms (+0.007 ms, +51.1%) 🔴
App start TTI 671.211 ms → 666.050 ms (-5.161 ms, -0.8%)
Open Search Page TTI 611.183 ms → 602.807 ms (-8.377 ms, -1.4%)
Show details
Name Duration
App start nativeLaunch Baseline
Mean: 10.200 ms
Stdev: 1.815 ms (17.8%)
Runs: 8 8 8 8 8 8 8 8 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 13 13 13 14

Current
Mean: 19.833 ms
Stdev: 1.572 ms (7.9%)
Runs: 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 21 21 21 22 22 24 24
App start runJsBundle Baseline
Mean: 176.586 ms
Stdev: 13.250 ms (7.5%)
Runs: 156 156 157 157 162 163 167 169 169 170 172 173 174 176 176 177 177 179 180 182 182 185 186 187 192 193 194 202 208

Current
Mean: 183.774 ms
Stdev: 18.291 ms (10.0%)
Runs: 159 159 159 167 169 169 171 171 171 172 174 177 177 178 179 179 180 181 184 184 185 186 186 195 196 198 202 215 220 222 232
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (8.7%)
Runs: 0.011799999512732029 0.012206999585032463 0.012329000048339367 0.012368999421596527 0.012532000429928303 0.012817000038921833 0.01281800027936697 0.013061000034213066 0.013224000111222267 0.013306000269949436 0.013509000651538372 0.013712000101804733 0.013875000178813934 0.013915999792516232 0.013915999792516232 0.013957000337541103 0.014038000255823135 0.014078999869525433 0.014078999869525433 0.014078999869525433 0.014159999787807465 0.014282000251114368 0.0143630001693964 0.015054999850690365 0.015056000091135502 0.015217999927699566 0.015300000086426735 0.015340999700129032 0.016560999676585197 0.017008000053465366

Current
Mean: 0.021 ms
Stdev: 0.002 ms (10.2%)
Runs: 0.0183100001886487 0.018635999411344528 0.0186769999563694 0.0186769999563694 0.019042999483644962 0.019288000650703907 0.01953099947422743 0.019612999632954597 0.019694000482559204 0.019816000014543533 0.020142000168561935 0.020304000005126 0.020711000077426434 0.020750999450683594 0.020955000072717667 0.021158999763429165 0.0211990000680089 0.021403000690042973 0.021524999290704727 0.021688000299036503 0.021729000844061375 0.021971999667584896 0.022134999744594097 0.022909000515937805 0.02307100035250187 0.023843999952077866 0.023843999952077866 0.028971999883651733
App start TTI Baseline
Mean: 671.211 ms
Stdev: 28.799 ms (4.3%)
Runs: 615.612854000181 633.9056789996102 637.6959929997101 638.5596340000629 640.2717209998518 641.4462970001623 646.4272170001641 647.5686649996787 648.4989179996774 650.4587470004335 650.5890589999035 653.8871200000867 657.7238400001079 660.745625000447 666.4555620001629 667.7362240003422 674.7953159995377 675.4363980004564 679.8193789999932 679.8340710001066 679.8829899998382 680.9263739995658 681.2964110001922 688.2205940000713 689.0527200000361 693.8325479999185 699.5078940000385 705.2440910004079 712.6717779999599 713.3048769999295 729.6487729996443 737.6901669995859

Current
Mean: 666.050 ms
Stdev: 22.862 ms (3.4%)
Runs: 623.7976719997823 630.1913909995928 633.3024359997362 638.0453519998118 645.437389000319 648.7929849997163 649.9102929998189 651.0041159996763 652.4998800000176 653.9731769999489 654.089712000452 656.2653480004519 657.0140639999881 661.1191619997844 663.1022119997069 664.0534760002047 668.1942769996822 669.0683789998293 669.5849249996245 676.9169479999691 677.2018879996613 677.8749869996682 678.5003880001605 679.9943469995633 688.4736730000004 691.3304789997637 691.5675990004092 697.9001420000568 704.50607999973 727.7912480002269
Open Search Page TTI Baseline
Mean: 611.183 ms
Stdev: 22.976 ms (3.8%)
Runs: 564.5171310007572 569.4393719993532 581.516277000308 582.5072029996663 584.8222260000184 589.1338299997151 592.4923910005018 596.6482340004295 597.4218350006267 598.950521000661 598.9676109999418 601.2829189999029 601.8218590002507 603.5561929997057 604.1112470002845 605.746744999662 610.2928060004488 610.3746750000864 612.8225919995457 619.881674000062 621.0796709991992 621.1544190002605 623.5988369993865 624.0217690002173 625.5975339999422 628.012654999271 628.4787200000137 632.7192799998447 639.4713550005108 641.4195159999654 641.9416100000963 643.116049000062 672.1223550001159

Current
Mean: 602.807 ms
Stdev: 24.590 ms (4.1%)
Runs: 561.3571779998019 566.8204749999568 568.7485760003328 575.272135999985 577.3885909998789 579.0450440002605 579.556599999778 581.3046880001202 584.9997970005497 586.9078780002892 587.5861409995705 589.0085450001061 591.0678710006177 594.7189950002357 595.5057380003855 599.3487139996141 599.5957849994302 600.8504650006071 603.6761480001733 605.796427000314 606.1684980001301 608.5852060001343 610.6630859998986 616.5192870004103 619.2477620001882 624.7103269994259 624.8975020004436 627.9991060001776 632.4608970005065 635.1591799994931 650.5297849997878 652.3364260001108 654.7819010000676

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

github-actions bot commented Jan 9, 2023

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

@luacmartins
Copy link
Contributor

Discussion here. We are safe to remove the deploy blocker label since these are meaningless changes and were likely introduced here

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Jan 9, 2023
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @stitesExpensify in version: 1.2.52-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.2.52-4 🚀

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.

6 participants