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

correct file uri set order #14823

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

Pujan92
Copy link
Contributor

@Pujan92 Pujan92 commented Feb 3, 2023

Details

Correct the file uri setting order that confirms the uri presents and avoid infinite loading while uploading the profile picture.

Fixed Issues

$ #14757
PROPOSAL: #14757 (comment)

Tests

  1. Go to the profile page
  2. Choose upload photo
  3. Select any pic with special char in file name
  4. Observe it proceeds to crop part and able to save it successfully
  • Verify that no errors appear in the JS console

Offline tests

  1. Go to the profile page
  2. Choose upload photo
  3. Select any pic with special char in file name
  4. Observe it proceeds to crop part and able to save it successfully

QA Steps

  1. Go to the profile page
  2. Choose upload photo
  3. Select any pic with special char in file name
  4. Observe it proceeds to crop part and able to save it successfully
  • 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.
  • 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-02-03.at.6.39.48.PM.mov
Mobile Web - Chrome

mobile (7)

Mobile Web - Safari

mobile (6)

Desktop
Screen.Recording.2023-02-04.at.2.00.43.AM.mov
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2023-02-04.at.02.02.32.mp4
Android

angif

@Pujan92 Pujan92 requested a review from a team as a code owner February 3, 2023 20:36
@melvin-bot melvin-bot bot requested review from thesahindia and thienlnam and removed request for a team February 3, 2023 20:36
@melvin-bot
Copy link

melvin-bot bot commented Feb 3, 2023

@thienlnam @thesahindia 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]

@thesahindia
Copy link
Member

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
Screen.Recording.2023-02-04.at.2.12.34.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-02-04.at.2.14.44.AM.mov
Mobile Web - Safari
Screen.Recording.2023-02-04.at.2.18.10.AM.mov
Desktop
Screen.Recording.2023-02-04.at.2.16.12.AM.mov
iOS
Screen.Recording.2023-02-04.at.2.17.18.AM.mov
Android
Screen.Recording.2023-02-04.at.2.13.33.AM.mov

Copy link
Member

@thesahindia thesahindia left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@thienlnam, all yours!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

⚠️ ⚠️ 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.

@thienlnam thienlnam merged commit 2a8e6a8 into Expensify:main Feb 3, 2023
@thienlnam
Copy link
Contributor

Thanks for the quick work on this both of you

OSBotify pushed a commit that referenced this pull request Feb 3, 2023
OSBotify added a commit that referenced this pull request Feb 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 676.057 ms → 719.285 ms (+43.228 ms, +6.4%)
App start runJsBundle 180.813 ms → 193.806 ms (+12.994 ms, +7.2%)
Open Search Page TTI 603.687 ms → 609.345 ms (+5.658 ms, +0.9%)
App start nativeLaunch 19.290 ms → 19.548 ms (+0.258 ms, +1.3%)
App start regularAppStart 0.014 ms → 0.016 ms (+0.001 ms, +7.6%)
Show details
Name Duration
App start TTI Baseline
Mean: 676.057 ms
Stdev: 32.004 ms (4.7%)
Runs: 621.3878870001063 637.022944000084 637.8022590000182 637.8718110001646 639.9966660002246 644.7893389998935 645.0543120000511 647.4825579999015 649.1949950000271 649.3220420000143 651.5776269999333 658.6702820002101 668.232995999977 668.8216889998876 669.3101400001906 670.0919479997829 672.3716199998744 676.3672850001603 677.3365719998255 684.0937720001675 684.4992949999869 689.3361370000057 693.8802260002121 698.3235200000927 701.8675919999368 705.6130059999414 708.5473819999024 711.1010850002058 713.3837140002288 734.0876020002179 740.5780739998445 745.8165299999528

Current
Mean: 719.285 ms
Stdev: 28.774 ms (4.0%)
Runs: 680.6657879999839 686.6902620000765 687.4976490000263 689.0307249999605 690.5641390001401 691.0336649999954 693.6361739998683 697.7653850000352 703.2551350002177 704.9860780001618 705.8640009998344 705.9761580000632 706.8542080000043 706.9706410001963 708.7654240000993 709.3171359999105 709.64139899984 710.7800099998713 713.7453990001231 717.1853609997779 720.3191249999218 722.7662749998271 725.6830059997737 729.8165980000049 743.3918110001832 746.3798139998689 747.8586349999532 751.4728910000995 757.2661879998632 775.2411259999499 776.3251939998008 800.3777930000797
App start runJsBundle Baseline
Mean: 180.813 ms
Stdev: 16.245 ms (9.0%)
Runs: 153 158 161 161 161 162 164 165 171 172 173 173 175 175 179 180 182 182 184 185 185 187 188 188 189 191 196 204 204 211 212 215

Current
Mean: 193.806 ms
Stdev: 19.236 ms (9.9%)
Runs: 168 172 172 172 173 175 175 177 181 182 182 184 188 189 190 193 194 194 194 195 197 198 200 202 207 210 216 217 229 236 246
Open Search Page TTI Baseline
Mean: 603.687 ms
Stdev: 21.366 ms (3.5%)
Runs: 572.5168459997512 573.1928309998475 575.1623539999127 575.9232180002145 577.8338219998404 578.9752199999057 582.5925710001029 583.9288729997352 585.0174969998188 585.5795900002122 587.4229739997536 591.271525000222 595.1978759998456 597.0102539998479 601.1934819999151 603.9706620001234 606.5257570003159 607.9717619996518 608.1081129997037 608.9335130001418 610.215739000123 611.9508869997226 618.3585210000165 621.1035569999367 621.9197599999607 621.9617519997992 627.2775480002165 632.7424319996499 632.7731120004319 632.793008999899 640.377726000268 648.188355000224

Current
Mean: 609.345 ms
Stdev: 16.611 ms (2.7%)
Runs: 580.3921719999053 581.6640630001202 588.0544029995799 588.2694089999422 591.2223720001057 591.2740879999474 592.9523519999348 593.6253659999929 593.9685470000841 598.159953000024 602.6232509999536 603.2148850001395 604.9723720001057 605.1634930004366 605.5091559998691 608.169474999886 608.5948080001399 609.4746909998357 610.4224050003104 611.8744710003957 614.0999759999104 614.3465990000404 617.137898999732 619.0992839997634 619.3526619998738 623.6659750002436 624.9982909997925 626.1823330000043 627.2559819999151 630.6258140001446 632.6116140000522 638.6217450001277 650.7952069998719
App start nativeLaunch Baseline
Mean: 19.290 ms
Stdev: 1.921 ms (10.0%)
Runs: 16 17 17 17 17 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 20 21 21 21 21 21 21 22 22 23 24

Current
Mean: 19.548 ms
Stdev: 2.227 ms (11.4%)
Runs: 17 17 17 17 17 17 18 18 18 18 18 18 18 19 19 19 19 20 20 20 20 20 21 21 21 21 22 23 24 24 25
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (6.8%)
Runs: 0.012654999736696482 0.012858000118285418 0.013143000192940235 0.013306000269949436 0.013549000024795532 0.013591000344604254 0.013753000181168318 0.013794000260531902 0.013794000260531902 0.01383400009945035 0.013916000258177519 0.014119999948889017 0.014403999783098698 0.014485000167042017 0.014526000246405602 0.014649000018835068 0.014649000018835068 0.014689000323414803 0.014811000321060419 0.014812000095844269 0.015015000011771917 0.015218000393360853 0.015299000311642885 0.015300000086426735 0.015503000002354383 0.015625 0.015910000074654818 0.01615400006994605 0.016844999976456165

Current
Mean: 0.016 ms
Stdev: 0.001 ms (6.7%)
Runs: 0.013224000111222267 0.014119999948889017 0.014282000251114368 0.014403999783098698 0.014566999860107899 0.014607999939471483 0.014688999857753515 0.014689000323414803 0.014811000321060419 0.01509599993005395 0.015217999927699566 0.015339999925345182 0.015339999925345182 0.015461999922990799 0.015746999997645617 0.01582799991592765 0.01599099999293685 0.016032000072300434 0.01607300015166402 0.016112999990582466 0.016112999990582466 0.01615400006994605 0.01615400006994605 0.016276000067591667 0.016479999758303165 0.0166830001398921 0.01696799974888563 0.017293999902904034 0.01822899980470538

@OSBotify
Copy link
Contributor

OSBotify commented Feb 3, 2023

🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.2.64-6 🚀

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

OSBotify commented Feb 4, 2023

🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.64-7 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Feb 4, 2023

🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.64-7 🚀

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

1 similar comment
@OSBotify
Copy link
Contributor

OSBotify commented Feb 4, 2023

🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.64-7 🚀

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

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

4 participants