Skip to content

Updated react-native-image-picker to 4.10.2 - #13246

Merged
mountiny merged 1 commit into
Expensify:mainfrom
s77rt:update-react-native-image-picker
Dec 6, 2022
Merged

mountiny merged 1 commit into
Expensify:mainfrom
s77rt:update-react-native-image-picker

Conversation

@s77rt

@s77rt s77rt commented Dec 1, 2022 •

Copy link
Copy Markdown
Member

Details

Updated react-native-image-picker to get the latest update from react-native-image-picker/react-native-image-picker#2056

Fixed Issues

$ #12283
PROPOSAL: #12283 (comment)

Tests

1 .Go to Settings > Camera > Format > ensure that "high-efficiency" is enabled
2. Open the iOS app
3. Visit any DM
4. Take a picture with the native iOS camera, ensuring that "live" photo is disabled
5. Tap the grey plus icon to the right of the chat input
6. Select a image from your camera roll (for iOS should be HEIC files by default)
7. Upload the image
8. Verify that the image is uploaded successfully

  • Verify that no errors appear in the JS console

Offline tests

Not Applicable

QA Steps

1 .Go to Settings > Camera > Format > ensure that "high-efficiency" is enabled
2. Open the iOS app
3. Visit any DM
4. Take a picture with the native iOS camera, ensuring that "live" photo is disabled
5. Tap the grey plus icon to the right of the chat input
6. Select a image from your camera roll (for iOS should be HEIC files by default)
7. Upload the image
8. Verify that the image is uploaded 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:
    • 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 was added in all src/languages/* files
    • 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 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Not Applicable
Mobile Web - Chrome Not Applicable
Mobile Web - Safari

Not Applicable

Desktop Not Applicable
iOS
Kooha-2022-12-05-20-51-52.mp4
Android Not Applicable

@s77rt
s77rt requested a review from a team as a code owner December 1, 2022 19:53
@melvin-bot
melvin-bot Bot requested review from Gonals and Santhosh-Sellavel and removed request for a team December 1, 2022 19:53
@melvin-bot

melvin-bot Bot commented Dec 1, 2022

Copy link
Copy Markdown

@Gonals @Santhosh-Sellavel 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]

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@s77rt LGTM, can you although test this issue did not come back? and leave a screen recording? thttps://github.com//issues/9424

Thank you!

@s77rt

s77rt commented Dec 1, 2022

Copy link
Copy Markdown
Member Author

@mountiny The change completely unrelated to the linked issue. The size won't double, we are just choosing another format

@mountiny

mountiny commented Dec 1, 2022

Copy link
Copy Markdown
Contributor

The change completely unrelated to the linked issue. The size won't double, we are just choosing another format

I was just asking because you have previously suggested the fix for the doubling logic should be reverted

@s77rt

s77rt commented Dec 1, 2022

Copy link
Copy Markdown
Member Author

@mountiny Yeah because it was part of the issue, I have noted this here react-native-image-picker/react-native-image-picker#2056

By the way, before react-native-image-picker/react-native-image-picker#2006 selecting HEIC files was also resulting in JPEG files

After the fix, the size was no longer double but also we were not getting any JPEG file only HEIC.
And now with the latest PR we will get JPEG for HEIC files and the previous fix is untouched.

It's all good now, we just need to test this PR to be sure the HEIC issue is fixed

@mountiny

mountiny commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

@Santhosh-Sellavel Let us know if you can get to this one or we can send this review to the pool

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

I'll get to it today.

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Santosh, code lgtm, just need to test

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt Please other platforms screen even, it's not affected. Please include the simulator for iOS. To Ensure everything is working as expected!

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

The change is specific to iOS. Uploading other screenshots is completely redundant.

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

The test cannot be made on a simulator. Must be a real device, that's a known bug that iOS simulator does not handle phpicker heic to jpeg format correctly.

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

The change is specific to iOS. Uploading other screenshots is completely redundant.

I think it is necessary to ensure .HEIC files work correctly on other platforms, so it's useful here!

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel
Would it make sense to test a code that didn't change? Obviously not.
We have nothing to test here except uploading heic on a real ios device. I hope that's clear.

Check the code change on the library, only one file has been changed, that's all. And that file only effects iOS.

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR is failing for android.

Screenshot_1670013330

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel Okay this is strange, if this is failing now means it was failing before.
Can you include more details about the image that is failing? (upload it here if possible)

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt

I just followed the test steps instead of iOS, I tried it on android Upload a .HEIC image

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel Something seems wrong, did you choose the option to upload a photo from gallery?
You are not supposed to explicitly select a .heic image,

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator
Screen_Recording_20221203_023221_New.Expensify.1.mp4

@s77rt

s77rt commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel Thanks for the test
But I have to ask you, can you please double check that you are running the latest version?
npm install react-native-image-picker@4.10.2
cd ios/ && rm Podfile.lock; pod install && cd ..
Verify that you see you Installing react-native-image-picker 4.10.2 (was 4.10.1)
Then rebuild the app

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Gonals @Santhosh-Sellavel I think if this works on iOS (I cannot test on physical device at the moment, we should get someone to try to send the picture not from gallery but from camera directly), we should merge this as this is quite annoying bug on iOS.

Then we can follow up with Android as that is i believe not that important usecase

@mountiny

mountiny commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Why does this fail with jpeg file though?

@Santhosh-Sellavel

Santhosh-Sellavel commented Dec 5, 2022 •

Copy link
Copy Markdown
Collaborator

I've tried to select the heic image only it shows names like that and failing to upload!

@Santhosh-Sellavel

Santhosh-Sellavel commented Dec 5, 2022 •

Copy link
Copy Markdown
Collaborator

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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 was added in all src/languages/* files
    • 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web, desktop & mWeb android it's not supported popup shown

Screenshot 2022-12-06 at 6 03 19 PM

PR Fails for Android

iOS
RPReplay_Final1670245651.MP4
Details
iOS mWeb
RPReplay_Final1670329955.MP4

@mountiny

mountiny commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

I've tried to select the heic image only it shows names like that and failing to upload!

Can we confirm:

  • user can select heic picture from the gallery in iOS
  • user can select heic picture from the gallery on Android
  • user can upload a picture taken from a camera in real device on iOS
  • user can upload a picture taken from a camera in real device on Android

That should be a goal of this PR. Android should have worked before so this is just to check regression.

@Santhosh-Sellavel Can you additionally please confirm if the jpeg image upload on android is failing in main too?

@Santhosh-Sellavel

Santhosh-Sellavel commented Dec 5, 2022 •

Copy link
Copy Markdown
Collaborator

@mountiny

Can we confirm:

  • user can select heic picture from the gallery in iOS
  • user can upload a picture taken from a camera in real device on iOS
RPReplay_Final1670245651.MP4
  • user can select heic picture from the gallery on Android
  • user can upload a picture taken from a camera in real device on Android

Pick Heic from Gallery/Document fails and take photo using inside the app pass.

Gallery_Fails_Take_Photo_inside_App_Pass.mp4

Take a photo from the Camera and upload it via Expensify fails

Also, it depends on what extension the file is saved, we can customize this in settings. When its HEIF format it fails.

Screen_Recording_20221205_193138_Media.Storage.mp4

That should be a goal of this PR. Android should have worked before so this is just to check regression.

@Santhosh-Sellavel Can you additionally please confirm if the jpeg image upload on android is failing in main too?

Normal jpgs/jpegs uploaded successfully

Screen_Recording_20221205_193300_Files.mp4

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt Can you update the test steps more clearly?

Please use steps from here that makes more sense

@mountiny

mountiny commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Thank for thorough testing @Santhosh-Sellavel seems like the heic format issues are not resolved yet @s77rt

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel @mountiny
Thanks for your time.

@Santhosh-Sellavel Can I get the photos you are testing with?
I'm not sure what's going on, I assumed that for every heic file there is always a jpeg file that iOS will hand us. So maybe this is wrong and for some heic files all we have is the heic file and we have to convert it explicitly. I doubt it but it may be the case, getting the photos you are testing with will help me confirm that.
Also, if possible can you test with the image that comes per default with iOS? the one with pink and yellow flowers

Unfortunately I'm unable to debug any further due to simulator limitation.

@Santhosh-Sellavel I have to ask you, are you sure you are using the latest react-native-image-picker?

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt

Here is the diff, I have used the version in the PR only. As you can see here iOS works fine

$ git diff                                    
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 00b569a90e..c47714fbae 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -472,7 +472,7 @@ PODS:
     - React-Core
   - react-native-image-manipulator (1.0.5):
     - React
-  - react-native-image-picker (4.10.1):
+  - react-native-image-picker (4.10.2):
     - React-Core
   - react-native-netinfo (8.3.1):
     - React-Core
@@ -980,7 +980,7 @@ SPEC CHECKSUMS:
   react-native-document-picker: f68191637788994baed5f57d12994aa32cf8bf88
   react-native-flipper: dc5290261fbeeb2faec1bdc57ae6dd8d562e1de4
   react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56
-  react-native-image-picker: f2ab1215d17bcfe27b0eb6417cc236fd1f4775e7
+  react-native-image-picker: bf34f3f516d139ed3e24c5f5a381a91819e349ea
   react-native-netinfo: 1a6035d3b9780221d407c277ebfb5722ace00658
   react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa
   react-native-plaid-link-sdk: 77052f329310ff5a36ddda276793f40d27c02bc4
diff --git a/package-lock.json b/package-lock.json
index 70c9e462d4..29cd4ab8f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -65,7 +65,7 @@
         "react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#3bbd17d63e6c38d38d857b50f6037c1c0376ff06",
         "react-native-haptic-feedback": "^1.13.0",
         "react-native-image-pan-zoom": "^2.1.12",
-        "react-native-image-picker": "^4.10.1",
+        "react-native-image-picker": "^4.10.2",
         "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972",
         "react-native-modal": "^13.0.0",
         "react-native-onyx": "1.0.29",
@@ -35419,9 +35419,9 @@
       }
     },
     "node_modules/react-native-image-picker": {
-      "version": "4.10.1",
-      "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.1.tgz",
-      "integrity": "sha512-tPA9UtboEsZ8qtm7pX9WInlo9sf0J2ArJgP4uVgKw1QNrwkRX/kZQ6uzOSN747Dhj9WS42ce4RN+rFK86J13DQ==",
:...skipping...
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 00b569a90e..c47714fbae 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -472,7 +472,7 @@ PODS:
     - React-Core
   - react-native-image-manipulator (1.0.5):
     - React
-  - react-native-image-picker (4.10.1):
+  - react-native-image-picker (4.10.2):
     - React-Core
   - react-native-netinfo (8.3.1):
     - React-Core
@@ -980,7 +980,7 @@ SPEC CHECKSUMS:
   react-native-document-picker: f68191637788994baed5f57d12994aa32cf8bf88
   react-native-flipper: dc5290261fbeeb2faec1bdc57ae6dd8d562e1de4
   react-native-image-manipulator: c48f64221cfcd46e9eec53619c4c0374f3328a56
-  react-native-image-picker: f2ab1215d17bcfe27b0eb6417cc236fd1f4775e7
+  react-native-image-picker: bf34f3f516d139ed3e24c5f5a381a91819e349ea
   react-native-netinfo: 1a6035d3b9780221d407c277ebfb5722ace00658
   react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa
   react-native-plaid-link-sdk: 77052f329310ff5a36ddda276793f40d27c02bc4
diff --git a/package-lock.json b/package-lock.json
index 70c9e462d4..29cd4ab8f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -65,7 +65,7 @@
         "react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#3bbd17d63e6c38d38d857b50f6037c1c0376ff06",
         "react-native-haptic-feedback": "^1.13.0",
         "react-native-image-pan-zoom": "^2.1.12",
-        "react-native-image-picker": "^4.10.1",
+        "react-native-image-picker": "^4.10.2",
         "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972",
         "react-native-modal": "^13.0.0",
         "react-native-onyx": "1.0.29",
@@ -35419,9 +35419,9 @@
       }
     },
     "node_modules/react-native-image-picker": {
-      "version": "4.10.1",
-      "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.1.tgz",
-      "integrity": "sha512-tPA9UtboEsZ8qtm7pX9WInlo9sf0J2ArJgP4uVgKw1QNrwkRX/kZQ6uzOSN747Dhj9WS42ce4RN+rFK86J13DQ==",
+      "version": "4.10.2",
+      "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.2.tgz",
+      "integrity": "sha512-3h9PrA1dQ84rVeipzQE4eWTELvflSHNtJZN6rz7NkZyaxo9YZV8H/TswBpHwiS5YWlyu+zlLzSoWVa1opSu7GA==",
       "peerDependencies": {
         "react": "*",
         "react-native": "*"
@@ -69780,9 +69780,9 @@
       "requires": {}
     },
     "react-native-image-picker": {
-      "version": "4.10.1",
-      "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.1.tgz",
-      "integrity": "sha512-tPA9UtboEsZ8qtm7pX9WInlo9sf0J2ArJgP4uVgKw1QNrwkRX/kZQ6uzOSN747Dhj9WS42ce4RN+rFK86J13DQ==",
+      "version": "4.10.2",
+      "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.2.tgz",
+      "integrity": "sha512-3h9PrA1dQ84rVeipzQE4eWTELvflSHNtJZN6rz7NkZyaxo9YZV8H/TswBpHwiS5YWlyu+zlLzSoWVa1opSu7GA==",
       "requires": {}
     },
     "react-native-image-size": {
diff --git a/package.json b/package.json
index 849ee69d72..ef14c28a09 100644
--- a/package.json
+++ b/package.json
@@ -95,7 +95,7 @@
     "react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#3bbd17d63e6c38d38d857b50f6037c1c0376ff06",
     "react-native-haptic-feedback": "^1.13.0",
     "react-native-image-pan-zoom": "^2.1.12",
-    "react-native-image-picker": "^4.10.1",
+    "react-native-image-picker": "^4.10.2",
     "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972",
     "react-native-modal": "^13.0.0",
     "react-native-onyx": "1.0.29",
~
~

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel How can I get the images you are testing with? I'd like to test with those exact images to be sure.
I'm starting to think that the simulator limitation is due to a malformed image, so I need to check with another image.

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

try with a real android device, any heic images should do. https://filesamples.com/formats/heic

@Santhosh-Sellavel How can I get the images you are testing with? I'd like to test with those exact images to be sure. I'm starting to think that the simulator limitation is due to a malformed image, so I need to check with another image.

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel Hmmm, I see this is a raw heic file, I think iOS or any other platform won't give us a jpeg representation because they only have heic, i will check if we do get a jpeg representation or not.
In the meantime please try using a default image that comes with iOS

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel
Okay here what I have as news;

  1. There is no simulator limitation, it's just the simulator version of the image (pink and yellow flowers) is broken, the image does not have a proper jpeg representation on the simulator. Besides that the simulator handles heic files just well.
  2. iOS will always hand us a jpeg representation even if the file is raw .heic
  3. I tested the same image you tested with here Updated react-native-image-picker to 4.10.2 #13246 (comment) and it works

Just to be sure, I have used the old version and produced the error you saw earlier, then applied my fix and tried again and it's working fine. So It's more likely you are using an old version.

(sorry for the unnecessary long video, the server host seems to be having network issues, just skip to the end)

Kooha-2022-12-05-20-51-52.mp4

@mountiny Since there is no simulator limitation you can test this as well, heic images: https://filesamples.com/formats/heic

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

iOS Works fine check recording here #13246 (comment) or #13246 (comment)

Issue only exists with android.

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

Well I have no idea why you are testing against android, this PR only targets iOS as that's what was the issue about.
I have only made modification specific to iOS.

If it's not working on android that because it was never working on android.

@s77rt

s77rt commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

Android support for heic was only added on version 10
Making android support heic files is more a feature request than a bug but we should definitely do it

What do you think? should we merge this and handle android in a separate issue?

@mountiny

mountiny commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Honestly I think if the upload and photo taking/ upload works on iOs we can merge this. Heic on Android should be uncommon, but we should also investigate and fix this.

Due to focus on other priorities I wont review/ follow this PR anymore.

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt Can you update the test steps more clearly?

Please use steps from here that makes more sense

@s77rt bump

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

I've tried to select the heic image only it shows names like that and failing to upload!

Can we confirm:

  • user can select heic picture from the gallery in iOS
  • user can select heic picture from the gallery on Android
  • user can upload a picture taken from a camera in real device on iOS
  • user can upload a picture taken from a camera in real device on Android

That should be a goal of this PR. Android should have worked before so this is just to check regression.

@Santhosh-Sellavel Can you additionally please confirm if the jpeg image upload on android is failing in main too?

I tested as it was asked here, also it was part of reviewer checklist. To catch this type of bugs sooner.

@s77rt

s77rt commented Dec 6, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel Updated

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Checklist: #13246 (comment)

PR Fails for Android
Not supported error shown on mWeb Android, Desktop & Web

Tests pass on iOS & iOS mWeb|

Approving as we are okay with the iOS fix alone as mentioned here

cc: @Gonals @mountiny

@Santhosh-Sellavel

Copy link
Copy Markdown
Collaborator

@s77rt Offline tests should be, verify uploading attachment is greyed out!

@s77rt

s77rt commented Dec 6, 2022

Copy link
Copy Markdown
Member Author

@Santhosh-Sellavel I'm only doing tests for code that I made change into. I have not changed a single line in the App code. Just on the react-native-image-picker iOS side.
The only eligible test is that on iOS uploading a heic file will work, that's all.

Offline tests are a thing when the App code is changed and it's not the case here.
Same thing goes for Android tests, PR is not failing for android as it was never meant to fix anything related to android.

@mountiny

mountiny commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Thanks @Santhosh-Sellavel

@mountiny
mountiny merged commit ecee541 into Expensify:main Dec 6, 2022
@s77rt

s77rt commented Dec 6, 2022

Copy link
Copy Markdown
Member Author

Thanks for merging, this took an unexpected long time.
Wondering, Am I still eligible for the 50% bonus? As I did submit the PR early and it was okay at the first day to be merged

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀

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