App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Mobile browser camera too zoomed in and not focusing. (iPhone Pro Max 16)

Open m-natarajan opened this issue 1 year ago • 51 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.51-4 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @ryanschaffer Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1729635637264959

Action Performed:

  1. Open New Expensify in mobile browser (I used incognito tab on chrome on an iphone 16 pro max)
  2. Click green plus
  3. Click Submit Expense
  4. Enable camera permission
  5. Camera is too zoomed in and unable to focus

Expected Result:

The camera is at a normal zoom level and focuses on the text

Actual Result:

The camera is super zoomed in and unable to focus on the text

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • [ ] Android: Standalone
  • [ ] Android: HybridApp
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [ ] iOS: HybridApp
  • [x] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/8e2635a9-94ee-4176-893d-a54085d735d8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021852190537586837285
  • Upwork Job ID: 1852190537586837285
  • Last Price Increase: 2024-12-06
Issue OwnerCurrent Issue Owner: @alitoshmatov

m-natarajan avatar Oct 23 '24 16:10 m-natarajan

Triggered auto assignment to @RachCHopkins (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Oct 23 '24 16:10 melvin-bot[bot]

Opened an incognito window on iOS chrome and totally unable to tap into the email box. Tapped once and it says "please enter an email or phone number" in red. I am unable to tap to get the keyboard. Same non-incognito.

Got in on Safari.

Zoom is totally normal on iPhone 14 on iOS 18.0.1

RachCHopkins avatar Oct 24 '24 04:10 RachCHopkins

@m-natarajan is your team able to reproduce this?

RachCHopkins avatar Oct 24 '24 04:10 RachCHopkins

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

MelvinBot avatar Oct 24 '24 04:10 MelvinBot

Waiting on repro.

RachCHopkins avatar Oct 29 '24 04:10 RachCHopkins

Requested help here

RachCHopkins avatar Oct 30 '24 03:10 RachCHopkins

Applause has replicated this and said it's specific to mobile Chrome and this iPhone version.

RachCHopkins avatar Nov 01 '24 03:11 RachCHopkins

Job added to Upwork: https://www.upwork.com/jobs/~021852190537586837285

melvin-bot[bot] avatar Nov 01 '24 03:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (External)

melvin-bot[bot] avatar Nov 01 '24 03:11 melvin-bot[bot]

@RachCHopkins, @alitoshmatov Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 04 '24 18:11 melvin-bot[bot]

No proposals yet!

RachCHopkins avatar Nov 05 '24 05:11 RachCHopkins

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 08 '24 16:11 melvin-bot[bot]

No proposals, also can't reproduce as it requires physical iphone 16

alitoshmatov avatar Nov 10 '24 18:11 alitoshmatov

Posted internally to see if we can get some traction, maybe from an agency.

RachCHopkins avatar Nov 11 '24 22:11 RachCHopkins

@RachCHopkins, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 14 '24 09:11 melvin-bot[bot]

Hi! I’m Pedro Guerreiro from Callstack - expert contributor group. I’d like to work on this task!

pac-guerreiro avatar Nov 14 '24 10:11 pac-guerreiro

@RachCHopkins @m-natarajan I don't have the specific device but someone on the team has an iPhone 15 Pro.

I can think of three possibilities for this issue:

  1. The specific device has 3 cameras, so maybe the web API is picking the wrong camera
  2. The app is not picking the right camera
  3. The web API is not prepared for iPhone 16 Pro/Pro Max

I'll focus on the first possibility and let you know what are my findings!

pac-guerreiro avatar Nov 14 '24 10:11 pac-guerreiro

@RachCHopkins @m-natarajan

Thanks to @fabioh8010 we were able to reproduce this issue on iPhone 12 Pro Max :smile:

It seems that on Chrome, the camera is too zoomed in, on Safari it’s too zoomed out and on native it’s normal.

I suspect that the wrong camera is being picked on both safari and chrome.

I need to investigate if the problem lies on either the package, app or the web API. For that purpose I’m going to make a special edition of debug mode for this case only :smile: (don’t worry, I won’t add it to the app)

https://github.com/user-attachments/assets/3765dddc-b88e-4ca9-8254-ff470b1a7ba0

https://github.com/user-attachments/assets/1bec5bfd-7ad4-40d8-aa48-8448d6b6b007

https://github.com/user-attachments/assets/009db02b-2b8c-4bd6-a8d3-b23148eb0d3b

pac-guerreiro avatar Nov 14 '24 19:11 pac-guerreiro

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 15 '24 16:11 melvin-bot[bot]

I just discovered that if you open iphone's camera app at the same as you use it on web. Websites camera changes into different camera. I tested it on my iphone 12.

https://github.com/user-attachments/assets/3310f506-588e-40bc-84b7-6b5ccf8cf75a

alitoshmatov avatar Nov 17 '24 15:11 alitoshmatov

@pac-guerreiro Can you recheck if issue is still reproducible without camera app's interference

alitoshmatov avatar Nov 17 '24 15:11 alitoshmatov

I'll ask someone on my team to test this! Thanks 😄

pac-guerreiro avatar Nov 17 '24 22:11 pac-guerreiro

@RachCHopkins @m-natarajan

Last friday I reverted a change that was made about 10 months ago which aimed to fix the issue where the ultra wide camera was being picked on some devices. Then I opened a draft PR and asked @fabioh8010 to test it on his iPhone 12 Pro Max. It seemed to do the trick but I'll need to test it more to confirm that I'm not introducing more regressions.

pac-guerreiro avatar Nov 17 '24 22:11 pac-guerreiro

@RachCHopkins @m-natarajan

Today I wasn't able to test this fix but I applied @fabioh8010 feedback on the PR

pac-guerreiro avatar Nov 18 '24 22:11 pac-guerreiro

@RachCHopkins @m-natarajan

Today @fabioh8010 tested the PR again on his iPhone 12 Pro Max and it seems that it does fix this issue but reintroduces a regression.

Here are the results of Fabio's testing, before and after the fix:

Before After
Safari https://github.com/user-attachments/assets/d5f50e29-fbb5-4dc1-8191-93f277ad32aa https://github.com/user-attachments/assets/590fce98-d375-4158-84ce-63f83aa73c0e
Chrome https://github.com/user-attachments/assets/97b18b12-23f3-48b1-a712-55789f88ba28 https://github.com/user-attachments/assets/76d3bf6b-b232-4f73-b24a-3dfe87c50bcd

As you can see in the before recordings, in safari the camera is kind of zoomed out and in chrome is too zoomed in.

After applying the fix, which is a revert of this https://github.com/Expensify/App/pull/30460, the camera has the right zoom in both safari and chrome but it changes to the ultra angular when we leave and then return to the browser app.

This is proof that the ultra wide camera is picked even when we don't switch to the camera app:

https://github.com/user-attachments/assets/9451150d-8cdf-4488-902c-87aba33e20fd

It seems that there is no easy way to pick the right camera to use on web for devices with multiple back-facing cameras, as you can see in this issue - https://github.com/w3c/mediacapture-extensions/issues/20

pac-guerreiro avatar Nov 19 '24 23:11 pac-guerreiro

@alitoshmatov I'm not sure what the next steps are here or what role everyone has - Should @pac-guerreiro or @fabioh8010 be assigned to this issue? Do you think you could give me one paragraph of where we are at?

RachCHopkins avatar Nov 20 '24 07:11 RachCHopkins

@RachCHopkins @alitoshmatov this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Nov 20 '24 09:11 melvin-bot[bot]

@RachCHopkins I've been working on this, so I can be assigned if @alitoshmatov agrees.

From my side, I don't think there's much to do here because there's no solution that will work for all available mobile devices in the market. The only possible fix is to reintroduce a regression where the ultra wide camera gets used by some devices sometimes, but the user should be able to scan the document nonetheless.

Let me know what you decide and I'll happily do it 😄

pac-guerreiro avatar Nov 20 '24 18:11 pac-guerreiro

  • I don't think we are in are right direction. OP clearly states the problem and provides a screenshots of camera being too zoomed in and out of focus which I didn't see anyone here be able to reproduce.
  • I don't think we should focus on which camera the phone is using, since we are cannot fully control it.

I suggest we once again try to reproduce exactly the same bug mentioned in OP. If it is not reproducible on any other instance we can assume it is a very rare edge case

cc: @pac-guerreiro @RachCHopkins

alitoshmatov avatar Nov 20 '24 20:11 alitoshmatov

I suggest we once again try to reproduce exactly the same bug mentioned in OP.

I don't have the tools to do that, @pac-guerreiro is that something you can help with?

RachCHopkins avatar Nov 20 '24 21:11 RachCHopkins