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

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

Open
1 of 8 tasks
m-natarajan opened this issue Oct 23, 2024 · 58 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 23, 2024

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
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
ScreenRecording_10-23-2024.19-10-39_1.MP4

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-13
Issue OwnerCurrent Issue Owner: @alitoshmatov
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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.

@RachCHopkins
Copy link
Contributor

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
Copy link
Contributor

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

@RachCHopkins RachCHopkins added the Needs Reproduction Reproducible steps needed label Oct 24, 2024
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@RachCHopkins
Copy link
Contributor

Waiting on repro.

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@RachCHopkins
Copy link
Contributor

Requested help here

@RachCHopkins
Copy link
Contributor

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

@RachCHopkins RachCHopkins added Help Wanted Apply this label when an issue is open to proposals by contributors External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 1, 2024
Copy link

melvin-bot bot commented Nov 1, 2024

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

@melvin-bot melvin-bot bot changed the title Mobile browser camera too zoomed in and not focusing. (iPhone Pro Max 16) [$250] Mobile browser camera too zoomed in and not focusing. (iPhone Pro Max 16) Nov 1, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2024
Copy link

melvin-bot bot commented Nov 1, 2024

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

Copy link

melvin-bot bot commented Nov 4, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
@RachCHopkins
Copy link
Contributor

No proposals yet!

@melvin-bot melvin-bot bot removed the Overdue label Nov 5, 2024
Copy link

melvin-bot bot commented Nov 8, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 8, 2024
@alitoshmatov
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 10, 2024
@pac-guerreiro
Copy link
Contributor

@alitoshmatov here is the proof you asked for https://github.com/user-attachments/assets/a0d7152e-9736-46b9-8b90-0fd0850a15ae

As you can see, in mobile chrome the camera is too zoomed in.

The tested device is iPhone 12 Pro Max.

Thanks @fabioh8010 for being my tester once again 😄

Copy link

melvin-bot bot commented Nov 25, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
@pac-guerreiro
Copy link
Contributor

@RachCHopkins @alitoshmatov What should be the next steps here?

@alitoshmatov
Copy link
Contributor

@pac-guerreiro Thank you for retest, I did also manage to reproduce it on 12 pro max though not consistently.
I am not sure what should we do next, I don't think we have any clear RCA for this issue

@melvin-bot melvin-bot bot removed the Overdue label Nov 26, 2024
@pac-guerreiro
Copy link
Contributor

@alitoshmatov from what I understand, we're always picking the last video device from the list of available devices. In some devices, doing this will cause this issue because there's no standard that says that the last device is the normal camera.

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Nov 27, 2024

@pac-guerreiro Yes, I think selecting which camera to use is off the table here.

@fabioh8010
Copy link
Contributor

Hi, @pac-guerreiro is going to be OOO until December 12th, so I'm taking over this issue over him.

Copy link

melvin-bot bot commented Nov 29, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 29, 2024
@RachCHopkins
Copy link
Contributor

Ok, so it looks like where we are at is that Apple being Apple gives us no control over what camera is used, and it's a game of chance as far as which camera will be chosen. Is there any solution out there that can force iOS to use a particular camera?

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Dec 2, 2024

Is there any solution out there that can force iOS to use a particular camera?

@RachCHopkins There might be, but all of them are workarounds and might come with their own problems.

Based on my testing, this bug is very rare to come across, I consider this very limited edge-case and I think we should be fine with closing this issue. If not, we could benefit from inviting internal engineer to the discussion to help us make next decision.

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@fabioh8010
Copy link
Contributor

fabioh8010 commented Dec 2, 2024

@alitoshmatov I'm able to consistently reproduce this bug on all environments (dev, staging, prod) using Google Chrome with a iPhone with 3 cameras, that is what this issue is reporting.

I will be posting a summary of all problems / solutions soon.

@fabioh8010
Copy link
Contributor

@alitoshmatov @RachCHopkins While preparing the summary I did some testing and I was able to find a solution for both problems.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Actually there are two problems here:

1️⃣ - When opening the in-app camera for expense submitting, the camera will be zoomed-in if using a iPhone with 3 cameras and the Google Chrome app.

RPReplay_Final1733152347.MP4

2️⃣ - When switching to another app and coming back while the E/App was using the in-app camera, the camera will be zoomed-out if using a iPhone with 3 cameras and the Safari app. If using the Google Chrome app, the camera will be even more zoomed-in.

RPReplay_Final1733152473.MP4
RPReplay_Final1733152551.MP4

What is the root cause of that problem?

The problem 1️⃣ appears to only happen under these two conditions:

  1. You must use a iPhone that has 3 cameras (I don't know if it can happen with Android devices).
  2. You must use Google Chrome app for testing.

Similarly, the problem 2️⃣ appears to only happen under these two conditions:

  1. You must use a iPhone that has 3 cameras.
  2. You must use Safari or Google Chrome app for testing.

The problem 1️⃣ is happening due to the use of incorrect logic here to set the video constraints and zoom when the camera permissions are granted.

The problem 2️⃣ is not exclusive to this app. When switching between apps and coming back, the camera stream will reset its zoom settings and cause the mentioned issues. I was able to verify the same behavior outside E/App.

What changes do you think we should make in order to solve the problem?

To solve problem 1️⃣, we can simplify this whole logic to defer the video constraints/zoom choice to the camera system, by just specifying a constraint object without any additional logic.

To solve problem 2️⃣, we must "reset" the camera stream every time the user comes back to the browser app after switching to another app, thus making the camera stream use our desired constraint/zoom settings.

Changes can be checked in this Draft PR.

RPReplay_Final1733162831-compressed.MP4
RPReplay_Final1733162907-compressed.MP4

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Since this change is related to camera streaming, not sure how we can develop unit / UI tests for these use cases.

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Dec 6, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 6, 2024

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

@fabioh8010
Copy link
Contributor

@alitoshmatov kindly bump!

@alitoshmatov
Copy link
Contributor

@fabioh8010 That looks like a good plan and works. Just to confirm, does this changes not brake #29484 which introduce the piece of code that you are suggesting to remove?

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 10, 2024
@fabioh8010
Copy link
Contributor

@fabioh8010 That looks like a good plan and works. Just to confirm, does this changes not brake #29484 which introduce the piece of code that you are suggesting to remove?

I will confirm this!

Copy link

melvin-bot bot commented Dec 12, 2024

@RachCHopkins, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Dec 13, 2024

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

@fabioh8010
Copy link
Contributor

Working on this right now Melvin

@fabioh8010
Copy link
Contributor

Having problems with building for iOS device, will continue tomorrow

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

7 participants