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

[$125] mWeb/Chrome - Scan - Flash icon appears then disappears in Scan tab #29442

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 12, 2023 · 22 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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 Monthly KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 12, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.3.83-1

Reproducible in staging?: Yes

Reproducible in production?: No. New feature on staging.

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: Applause - Internal Team

Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to + > Request money > Scan
  3. Give camera permission if not yet

Expected Result:

Depending on whether flash is supported, the flash icon should either appear or not appear at all

Actual Result:

When the Scan tab is first opened, the camera flash icon on the bottom right corner appears and then disappears

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
Bug6234478_1697117658906.Screen_Recording_20231012_200316_Chrome.mp4
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019c363d1d939d77a1
  • Upwork Job ID: 1712523919628128256
  • Last Price Increase: 2023-10-12
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hungvu193
Copy link
Contributor

hungvu193 commented Oct 12, 2023

Proposal

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

Scan - Flash icon appears then disappears in Scan tab (Reproducible with mSafari as well).

What is the root cause of that problem?

We will show the flash if flash is available and make it invisible by decrease the opacity to zero in here when the flash is not available

<PressableWithFeedback
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
accessibilityLabel={translate('receipt.flash')}
style={[styles.alignItemsEnd, !isTorchAvailable && styles.opacity0]}
onPress={toggleFlashlight}
disabled={!isTorchAvailable}
>
<Icon
height={32}
width={32}
src={Expensicons.Bolt}
fill={isFlashLightOn ? themeColors.iconHovered : themeColors.textSupporting}
/>
</PressableWithFeedback>

Because isTorchAvailable has default value true, it will be visible first then disappeared after that after onTorchAvailability is fired.

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

That's quite confused to make it visible and then disappears like that, we should handle the flash button like the way we handle it on our mobile side by only disabling it if we didn't have the permission or it's not available.
So we should remove !isTorchAvailable && styles.opacity0 from our flash button styles.
We can also consider change the default value of isTorchAvailable to false to prevent user press on that button while we're checking for permission.

What alternative solutions did you explore? (Optional)

N/A

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Oct 12, 2023
@melvin-bot melvin-bot bot changed the title mWeb/Chrome - Scan - Flash icon appears then disappears in Scan tab [$500] mWeb/Chrome - Scan - Flash icon appears then disappears in Scan tab Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@mountiny mountiny changed the title [$500] mWeb/Chrome - Scan - Flash icon appears then disappears in Scan tab [$125] mWeb/Chrome - Scan - Flash icon appears then disappears in Scan tab Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

Upwork job price has been updated to $125

@mountiny
Copy link
Contributor

@hungvu193 is this regression from something?

@jasperhuangg
Copy link
Contributor

@mountiny @hungvu193 This appears to be a bug introduced from #28411, specifically from here

Wouldn't say it's a regression just a bug that wasn't caught during testing since this behavior didn't exist before on mWeb

@AndrewGable
Copy link
Contributor

IMO this isn't a blocker and just something @lukemorawski can fix as a follow up

@AndrewGable AndrewGable removed the DeployBlockerCash This issue or pull request should block deployment label Oct 12, 2023
@yakupafsin
Copy link
Contributor

PROPOSAL (UPWORK)

In this situation, there are two straightforward solutions.

Solution 1: Make the default value of "isTorchAvailable" "false." This is a quick and easy solution, but it may result in a slight delay for users who have granted torch permissions.

However, I propose an alternative solution to address this issue.

Solution 2: Introduce an additional variable called "indicator" with a default value of "true." When we gather information about the availability of the torch, set "isTorchAvailable" to either true or false, and set "indicator" to the opposite of "isTorchAvailable." This allows us to determine whether we have received the necessary data and are ready to display the screen.

I've chosen this approach to keep the code concise.

When the user opens the camera, we will display an Activity Indicator that covers the full screen to hide the background, based on this condition: if (isTorchAvailable === indicator).

For example:

//...
const [isTorchAvailable, setIsTorchAvailable] = useState(true);
const [indicator, setIndicator] = useState(true);
//...
//...
<NavigationAwareCamera
  // ...
  // ...
  onTorchAvailability={(availability) => { setIsTorchAvailable(availability); setIndicator(!isPageLoaded); }}
  // ...
/>
//..
//..
//..
const mobileCameraView = () => {
  if (isTorchAvailable === indicator) {
    // Show the indicator
  } else {
    // Show the rest of the screen
  }
}

@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

📣 @yakupafsin! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@yakupafsin
Copy link
Contributor

Contributor details
Your Expensify account email: yakupafsin422@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/yakupa13

@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@cubuspl42
Copy link
Contributor

@yakupafsin In the future, stick to the proposal template. Be sure to read the contributing guidelines.

In the context of this issue, I think we're not looking for proposals right now, as @lukemorawski might just fix this in a follow-up.

@lukemorawski
Copy link
Contributor

@cubuspl42 Fixed the issue, creating a PR for that.

@lukemorawski lukemorawski mentioned this issue Oct 13, 2023
62 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Daily KSv2 labels Oct 13, 2023
@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 13, 2023
@AndrewGable AndrewGable self-assigned this Oct 13, 2023
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@cubuspl42
Copy link
Contributor

I asked a question on #29569 to classify the state of this issue

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

This issue has not been updated in over 15 days. @AndrewGable, @allroundexperts, @kadiealexander eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week)

@kadiealexander
Copy link
Contributor

@allroundexperts @AndrewGable I also can't reproduce this, should we close it?

@allroundexperts
Copy link
Contributor

Yes, I think its safe to close this @kadiealexander.

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. 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 Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests