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 - Grant Camera Permission button not working on first click #27442

Closed
6 tasks
kbecciv opened this issue Sep 14, 2023 · 57 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 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 14, 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:

Pre Requisite - Make sure camera permission is declined

  1. Open FAB, Click Request money -> Scan Receipt
  2. Click on Grant Permission.
  3. If Permission Pop up open, deny permission.
  4. Repeat 2 and 3 until redirected to settings, Close app and remove from recent
  5. Open App , Open FAB, Click Request money -> Scan Receipt
  6. Click on Grant Permission

Expected Result:

Linked to App settings (as request permission is blocked by OS)

Actual Result:

Clicking button does nothing on first click.

Workaround:

Unknown

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.70.2
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation

Record_2023-09-11-22-36-35.mp4
Screen_Recording_20230914_094815_New.Expensify.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ishpaul777
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694451532440139

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019c4a398f728939bc
  • Upwork Job ID: 1702319435415248896
  • Last Price Increase: 2023-09-28
  • Automatic offers:
    • Ollyws | Reviewer | 26980712
    • zoontek | Contributor | 26980715
    • ishpaul777 | Reporter | 26980718
    • ntdiary | Contributor | 26981787
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 14, 2023
@melvin-bot melvin-bot bot changed the title Android - Grant Camera Permission button not working on first click [$500] Android - Grant Camera Permission button not working on first click Sep 14, 2023
@melvin-bot
Copy link

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

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

@melvin-bot
Copy link

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

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

melvin-bot bot commented Sep 14, 2023

Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

@akinwale
Copy link
Contributor

This may be a duplicate of #26499.

@trjExpensify
Copy link
Contributor

Yeah, it looks like it. @Julesssss, I'm going to close this but let me know if you disagree.

@ishpaul777
Copy link
Contributor

I was assigned to the #26499. I have to put the PR on Hold, as I was blocked by the same issue raised here, Another PR with similar changes I suggested #26499 got merged recently. So this issue is not a dupe, but a regression from the PR - #26231

@trjExpensify
Copy link
Contributor

But isn't #26499 the same problem as this issue, regardless of whether #26499 is a regression of PR - #26231?

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 14, 2023

No the issue in #26499 was that user always redirected to Settings page and a native modal never for asking permission never open, #26499 was created to fix that. But Work was already in progress to solve this issue in PR #26499, #26499 was a Dupe. The issue here is when the user click on "Grant Permission" it does not work for first time if user has declined the permission request in past. Hope I am clear with my explanation

@Julesssss
Copy link
Contributor

So this issue is not a dupe, but a regression from the PR

Not sure I would call it a regression, as that PR introduced the feature, just in a broken state.

But I do agree this is a separate issue. @trjExpensify it's slightly different:

@Julesssss Julesssss reopened this Sep 15, 2023
@Julesssss Julesssss self-assigned this Sep 15, 2023
@Julesssss
Copy link
Contributor

Though perhaps both will have the same solution. Here's the most recent plan of action

@trjExpensify
Copy link
Contributor

Okay, so this would be an eligible bug report. Do you want to hold this issue on #26499 going upstream?

@Julesssss
Copy link
Contributor

It's going to be a little bit confusing, but I'd actually say we can work on both in paralell.

@ishpaul777 it would be great if you wanted to work on both issues together? Please make a proposal for this one if youre interested.

@ishpaul777
Copy link
Contributor

Unfortunatley, I am unable to find a satifactory solution for both the issue yet. Will make a proposal once i find a solution.

@melvin-bot melvin-bot bot added the Overdue label Sep 20, 2023
@trjExpensify
Copy link
Contributor

@ishpaul777 any luck?

@melvin-bot melvin-bot bot removed the Overdue label Sep 20, 2023
@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 20, 2023

@Julesssss @trjExpensify
I spend some time looking into it, I think the best we can do is persist the blocked state for camera permission in onyx so when the permission is blocked we will persist the state in Onyx. Again when press "grant permission" we will check if permission is blocked by OS.

Changes -

function persistBlockedPermission(isCameraBlocked: boolean) {
    Onyx.merge(ONYXKEYS.PERMISSION_BLOCKED, {
        isCameraPermissionBlocked: isCameraBlocked,
    });
}
  • When user click "grant permission" and deny permission multiple time until OS blocks, we will store the state when permission state is "Blocked"

https://github.com/Expensify/App/blob/main/src/pages/iou/ReceiptSelector/index.native.js#L151

 const askForPermissions = () => {
        // There's no way we can check for the BLOCKED status without requesting the permission first
        // https://github.com/zoontek/react-native-permissions/blob/a836e114ce3a180b2b23916292c79841a267d828/README.md?plain=1#L670
        if (permissions === RESULTS.BLOCKED || isAndroidBlockedPermissionRef.current) {
            Linking.openSettings();
        } else if (permissions === RESULTS.DENIED) {
            CameraPermission.requestCameraPermission().then((permissionStatus) => {
                setPermissions(permissionStatus);
                if (permissionStatus !== RESULTS.BLOCKED) {
                    isAndroidBlockedPermissionRef.current = false;
                    Receipt.persistBlockedPermission(false);
                    return;
                }
                isAndroidBlockedPermissionRef.current = true;
                Receipt.persistBlockedPermission(true);
            });
        }
useEffect(() => {
        const subscription = AppState.addEventListener('change', (nextAppState) => {
            if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
                CameraPermission.getCameraPermissionStatus().then((permissionStatus) => {
                    setPermissions(permissionStatus);
+                   if (permissionStatus === RESULTS.GRANTED) {
+                       isAndroidBlockedPermissionRef.current = false;
+                      Receipt.persistBlockedPermission(false);
+                   }
                });
            }
            ....
 CameraPermission.getCameraPermissionStatus().then((permissionStatus) => {
        setPermissions(permissionStatus);
+        if (permissionStatus === RESULTS.GRANTED) {
+            isAndroidBlockedPermissionRef.current = false;
+           Receipt.persistBlockedPermission(false);
+        }
    });

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.83-11 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-20. 🎊

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 13, 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.
  • [@trjExpensify / @kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@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 - Grant Camera Permission button not working on first click [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] Android - Grant Camera Permission button not working on first click Oct 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.83-11 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-20. 🎊

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 13, 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.
  • [@trjExpensify / @kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@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 - Grant Camera Permission button not working on first click [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$500] Android - Grant Camera Permission button not working on first click 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.
  • [@trjExpensify / @kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@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 - Grant Camera Permission button not working on first click [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 - Grant Camera Permission button not working on first click 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.
  • [@trjExpensify / @kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 20, 2023
@Julesssss Julesssss 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 - Grant Camera Permission button not working on first click [HOLD for payment 2023-10-23] [$500] Android - Grant Camera Permission button not working on first click Oct 23, 2023
@Julesssss
Copy link
Contributor

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:

This is also a ux improvement. : )

@trjExpensify
Copy link
Contributor

Okay, so keeping these jobs separate for following the audit trail later if needs be. Confirming the payment summary as follows:

No #urgency bonus applied as per here.

@zoontek
Copy link
Contributor

zoontek commented Oct 23, 2023

@trjExpensify Sorry, I accepted it.

@trjExpensify
Copy link
Contributor

Perfect, settled up with everyone. Closing!

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants