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

[HOLD for payment 2023-10-23] [$500] [Android] User isn't prompted for Camera permission via the native Modal #26499

Closed
1 of 6 tasks
Julesssss opened this issue Sep 1, 2023 · 82 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.

Comments

@Julesssss
Copy link
Contributor

Julesssss commented Sep 1, 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!


Action Performed:

  1. Ensure the Camera permission is denied
  2. Tap FAB > Request money > Scan
  3. Click the 'Give Permission' button

Expected Result:

  • We should show the native Android request permission modal
  • Given that the user has tapped give permission, I don't think an initial 'We are going to ask you for permission' modal is required (it would in other cases in order to prevent the OS from blocking future permission requests)
  • The solution should work exactly the same as it does for native Android/iOS apps

Actual Result:

I am deep linked directly to the top level generic app settings page, and must manually tap 'Permissions > Camera'

Workaround:

I must manually tap 'Permissions > Camera'. Some users might not know how to do this.

screen-20230901-162220.mp4

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.61-1
Reproducible in staging?: yes
Reproducible in production?: yes (once deployed)
Issue reported by: @Julesssss
Slack conversation: N/A

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f5f4967e2e242138
  • Upwork Job ID: 1698645305652506624
  • Last Price Increase: 2023-09-04
  • Automatic offers:
    • ntdiary | Reviewer | 26488566
    • ishpaul777 | Contributor | 26488567
    • zoontek | Contributor | 26980722
@Julesssss Julesssss added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 1, 2023
@Julesssss Julesssss self-assigned this Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 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

@Julesssss Julesssss added Improvement Item broken or needs improvement. Engineering labels Sep 1, 2023
@Julesssss
Copy link
Contributor Author

This is more of a feature improvement than a bug

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 1, 2023

@Julesssss what if we directly request permission with native pop up on click of button, if permission "denied" or "restricted" then show native alert modal similar to flow of launching camera while adding attachements.
ref - https://github.com/Expensify/App/blob/main/src/components/AttachmentPicker/launchCamera.android.js#L14C5-L23C11

Screeshot

Screenshot_2023-09-01-23-35-19-92_ab1359306de43320f9557c797b1c4be5.jpg

@akinwale
Copy link
Contributor

akinwale commented Sep 1, 2023

@Julesssss It's not possible to deep-link directly to the Camera settings page. The best option is to open the App settings page which is what is currently happening.

Also, the current implementation seems weird. I would assume that the app should try to request for the camera permission at least once (which shows a dialog to grant or deny the request), before making the user have to navigate to the device app settings.

@sakluger
Copy link
Contributor

sakluger commented Sep 1, 2023

@Julesssss do you need me to triage this issue or anything, or are you going to mostly manage the issue and I can just handle any contributor payments that come up?

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@Julesssss
Copy link
Contributor Author

Julesssss commented Sep 4, 2023

It's not possible to deep-link directly to the Camera settings page.

Ah, right. We can deep link directly to the location permission so I assumed it worked for all permissions. Oh well.

I would assume that the app should try to request for the camera permission at least once (which shows a dialog to grant or deny the request), before making the user have to navigate to the device app settings.

100% agree with this and ishpaul777's comment. That's what we should be doing on native Android.

@sakluger I'll update the description and will manage it.

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@Julesssss Julesssss changed the title [Android] Camera permission deep link doesn't take you directly to camera permission [Android] User isn't prompted for Camera permission via the native Modal Sep 4, 2023
@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Sep 4, 2023
@melvin-bot melvin-bot bot changed the title [Android] User isn't prompted for Camera permission via the native Modal [$500] [Android] User isn't prompted for Camera permission via the native Modal Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

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

melvin-bot bot commented Sep 4, 2023

Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@ishpaul777
Copy link
Contributor

Can i pick this @Julesssss ?

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 4, 2023

Proposal

Problem

User isn't prompted for Camera permission via the native Modal

Root cause

N/a , new feature/improvement

Changes

  • Modify askForPermissions to ask for permission everytime button is clicked
const askForPermissions = () => {
            Camera.requestCameraPermission().then((permissionStatus) => {
                setPermissionStatus(permissionStatus)
            })
            // optional Catch runtime errors
  };

@Julesssss
Copy link
Contributor Author

Julesssss commented Sep 4, 2023

@ishpaul777 correct me if I'm wrong, but I think only the second part of your solution is necessary. We are already checking for permission and showing the 'Grant Permission' button, so we can immediately show the prompt.

Why would we want to show the native modal if they deny the permission? (showPermissionsAlert )

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 4, 2023

that's what we do while launching camera in report.

Record_2023-09-04-16-30-47.mp4

"We are already checking for permission and showing the 'Grant Permission' button, so we can immediately show the prompt."

We can omit showing alert modal in this case then.

@Julesssss
Copy link
Contributor Author

Julesssss commented Sep 4, 2023

Ahm, so that is NOT a native permission modal. Cool

@ishpaul777
Copy link
Contributor

Proposal

Updated

@Julesssss
Copy link
Contributor Author

I still think that's not necessary in this case though. By tapping the button we can assume they intend to grant the permission. And if they then choose to deny it, we don't need to warn them. It's pretty obvious due to the illustration and 'Grant Permission' button that they won't be able to do anything until granted.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 13, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal Oct 13, 2023
@melvin-bot

This comment was marked as duplicate.

@melvin-bot

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal Oct 16, 2023
@melvin-bot

This comment was marked as duplicate.

@melvin-bot

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@ntdiary] The PR that introduced the bug has been identified. Link to the PR:
  • [@ntdiary] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@ntdiary] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@ntdiary] Determine if we should create a regression test for this bug.
  • [@ntdiary] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@sakluger sakluger changed the title [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] [Android] User isn't prompted for Camera permission via the native Modal [HOLD for payment 2023-10-23] [$500] [Android] User isn't prompted for Camera permission via the native Modal Oct 17, 2023
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 20, 2023
@Julesssss
Copy link
Contributor Author

Can be paid out today

@ntdiary
Copy link
Contributor

ntdiary commented Oct 23, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@ntdiary] The PR that introduced the bug has been identified. Link to the PR: Add ability to Take/Upload Receipts #23046
  • [@ntdiary] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/23046/files#r1368834273
  • [@ntdiary] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: No need
  • [@ntdiary] Determine if we should create a regression test for this bug. No need
  • [@ntdiary] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. No need
  • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

This is not a regression, just a UX improvement.

@sakluger
Copy link
Contributor

Looks like the offer to @ntdiary somehow expired. I sent a new offer, can you please accept?

@zoontek it also looks like you haven't accepted our offer for this job yet. Could you please accept and let me know so I can complete payment?

Thanks!

@zoontek
Copy link
Contributor

zoontek commented Oct 23, 2023

@sakluger Sorry, I accepted it.

@sakluger
Copy link
Contributor

Thanks @zoontek! I completed your payment.

@ntdiary
Copy link
Contributor

ntdiary commented Oct 24, 2023

Looks like the offer to @ntdiary somehow expired. I sent a new offer, can you please accept?

@sakluger, thank you! Accepted. : )

@sakluger
Copy link
Contributor

All done, thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

7 participants