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-05-16] [$500] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions #17876

Closed
1 of 6 tasks
kavimuru opened this issue Apr 24, 2023 · 37 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 Needs Reproduction Reproducible steps needed

Comments

@kavimuru
Copy link

kavimuru commented Apr 24, 2023

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


Action Performed:

  1. Open android app.
  2. Click on user image on top right to open settings page.
  3. Click on user image to open profile page.
  4. Click camera icon on user image > upload photo > take photo
  5. Popup appears asking to allow camera access permission
  6. Click on Do not allow.

Expected Result:

No console error

Actual Result:

Console error: Error during attachment selection: User did not grant permissions]

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
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
WhatsApp Image 2023-04-23 at 2 51 04 PM

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016c0dd6ef40ed6cfe
  • Upwork Job ID: 1650422194021990400
  • Last Price Increase: 2023-04-24
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Apr 24, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@flaviadefaria flaviadefaria added the External Added to denote the issue can be worked on by a contributor label Apr 24, 2023
@melvin-bot melvin-bot bot changed the title DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions [$1000] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions Apr 24, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

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

@tienifr
Copy link
Contributor

tienifr commented Apr 24, 2023

Proposal

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

Console error: Error during attachment selection: User did not grant permissions

What is the root cause of that problem?

The issue is from here

where we're logging the error if the user did not allow the permission.

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

We should not log the error if it's a permission/user-cancel issue since it's a valid and normal app use case. We can log error in other cases aside from permission/user-cancel issue.

This can be done by return resolve(); if we detect that it's 'permission' error here

this.showPermissionsAlert();

What alternative solutions did you explore? (Optional)

NA

@Prince-Mendiratta
Copy link
Contributor

Proposal

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

In this issue, we can notice that in the android app, when the user does not grant the permission, a popup is shown letting the user know that the permission is necessary. In dev however, along with the popup, an error is also shown which serves no real purpose and can be annoying.

What is the root cause of that problem?

Here, we can see that when an error occurs, we return that error to show a popup with a specific message.

if (response.errorCode) {
switch (response.errorCode) {
case 'permission':
this.showPermissionsAlert();
break;
default:
this.showGeneralAlert();
break;
}
return reject(new Error(`Error during attachment selection: ${response.errorMessage}`));
}

When there is a permission error, we show the alert using the showPermissionsAlert method and also reject the promise with an error, which is shown in dev.

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

I suggest that when there is only a permission error, we directly return instead of break after calling the showPermissionsAlert method. This is because since the warning is already shown, we need not necessarily reject the promise with an error since it only duplicates the error.

What alternative solutions did you explore? (Optional)

None

@zhanghui19880625
Copy link

I can make your app to the app don't ask camera permission.
In other words, when you install the apk, the permisions are allowed automatically.
for example, install mtk-engineering-mode-1-21.apk please.

@MelvinBot
Copy link

📣 @zhanghui19880625! 📣

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. 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.
  2. 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.
  3. 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>

@situchan
Copy link
Contributor

I don't think this is worth fixing. This is dev-only log and doesn't affect production users.

@tienifr
Copy link
Contributor

tienifr commented Apr 24, 2023

it’s quite disruptive though, it shows a huge error screen, causing panic even though it’s not really an “error”.

@zhanghui19880625
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01a7011af7bc60347a
I can make your app to the app don't ask camera permission.
In other words, when you install the apk, the permisions are allowed automatically.
for example, install mtk-engineering-mode-1-21.apk please.

@MelvinBot
Copy link

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

@mollfpr
Copy link
Contributor

mollfpr commented Apr 24, 2023

Hey @zhanghui19880625, I appreciate your interest in this issue! We have some guidelines to follow regarding start contribute to this repo. You can start with this CONTRIBUTING.md and see how the others submit their proposal.


For the others, I'm asking about this issue internally if we still want to fix it.

@WikusKriek
Copy link
Contributor

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01e4382d042b66e376

@MelvinBot
Copy link

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

@mountiny
Copy link
Contributor

mountiny commented Apr 24, 2023

I think the dev warnings should not be for $1000 usually, I will decrease the price tag to $500 for this one and no bonus

@mountiny mountiny changed the title [$1000] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions [$500] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions Apr 24, 2023
@MelvinBot
Copy link

Upwork job price has been updated to $500

@flaviadefaria
Copy link
Contributor

@mollfpr any thoughts on the proposals above?

@mollfpr
Copy link
Contributor

mollfpr commented Apr 26, 2023

@tienifr @Prince-Mendiratta Why do we need to return reject(new Error(Error during attachment selection: ${response.errorMessage})); in the first place? If we only resolve the error code permission, other than that will have the same issue as this?

@tienifr
Copy link
Contributor

tienifr commented Apr 26, 2023

@mollfpr I think it's because we want to log the error here

If we only resolve the error code permission, other than that will have the same issue as this?

The permission denial is not really an error, it's just an app use case, we can see it's separately handled by instructing the user to grant the permission here

this.showPermissionsAlert();
.

The other errors are valid errors and should be logged to get noticed. If by any chance we don't want to log it then can just remove this line

@mollfpr
Copy link
Contributor

mollfpr commented Apr 26, 2023

Thanks @tienifr that make sense to me!

We should not log the error if it's a permission/user-cancel issue since it's a valid and normal app use case. We can log error in other cases aside from permission/user-cancel issue.

This can be done by return resolve(); if we detect that it's 'permission' error here

@tienifr Where should we put return resolve();?

@tienifr
Copy link
Contributor

tienifr commented Apr 26, 2023

This can be done by return resolve(); if we detect that it's 'permission' error here

this.showPermissionsAlert();

@mollfpr I've linked the permalink for where we put in in the original proposal, we should add it below the line in the permalink (below the this.showPermissionsAlert();, replacing break;).

@mollfpr
Copy link
Contributor

mollfpr commented Apr 26, 2023

Thanks @tienifr!

@marcochavezf From what @tienifr explained here I understand that we should keep the error log for other code. Using return resolve(); is aligned with the previous code where the response is canceled. So I'm recommend @tienifr proposal.

🎀 👀 🎀 C+ reviewed!

@flaviadefaria
Copy link
Contributor

@marcochavezf are good with @mollfpr's recommendation? If so can you assign @tienifr to the issue?

@marcochavezf
Copy link
Contributor

Great! Thanks @mollfpr for the review! Assigning @tienifr

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 27, 2023
@MelvinBot
Copy link

📣 @tienifr You have been assigned to this job by @marcochavezf!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@tienifr
Copy link
Contributor

tienifr commented Apr 28, 2023

The PR is ready for review #18126!

@melvin-bot
Copy link

melvin-bot bot commented May 5, 2023

@marcochavezf, @mollfpr, @flaviadefaria, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@marcochavezf
Copy link
Contributor

Not overdue, PR deployed to staging.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 9, 2023
@melvin-bot melvin-bot bot changed the title [$500] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions [HOLD for payment 2023-05-16] [$500] DEV : Console error on not allowing camera access permissions. Error during attachment selection: User did not grant permissions May 9, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.12-0 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-05-16. 🎊

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

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 May 9, 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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@mollfpr] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@flaviadefaria] 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 and removed Weekly KSv2 labels May 15, 2023
@flaviadefaria
Copy link
Contributor

Coming from this comment:

I think the dev warnings should not be for $1000 usually, I will decrease the price tag to $500 for this one and no bonus

@mollfpr $500
@tienifr $500
@aneequeahmad $250

@flaviadefaria
Copy link
Contributor

@mollfpr can you please all fill out the checklist above? Thanks!

@mollfpr
Copy link
Contributor

mollfpr commented May 16, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:
[@mollfpr] 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:

There's no offending PR to this since it's not a bug but an improvement on the DEV, where it's a bit annoying and we don't need the console error for that.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

I don't think we need one, the console error is not showing in the production release.

cc @flaviadefaria @marcochavezf

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 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests