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 2024-10-17] [$250] Use local Onyx key to throttle location permission prompts #47800

Closed
6 tasks
garrettmknight opened this issue Aug 21, 2024 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@garrettmknight
Copy link
Contributor

garrettmknight commented Aug 21, 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: N/A
Reproducible in staging?: N/A
Reproducible in production?: N/A
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: https://github.com/Expensify/Expensify/issues/378927
Issue reported by: @Julesssss
Slack conversation:

Prerequisite - make sure location services is disabled for New Expensify

Action Performed:

  1. Sign up with a new account
  2. Big + > Submit expense
  3. Scan receipt
  4. Select a recipient
  5. Submit expense
  6. See the location services request > tap Not Now
  7. When the system request comes up, tap 'Don't Allow'
  8. Big + > Submit expense
  9. Scan receipt
  10. Select a recipient

Current Result:

Every time the user creates a money request, we prompt them to enable the location permission.

Requested Result:

Instead of waiting for a backend solution, we can use a local Onyx key/timestamp to prevent the modal from showing. Let's implement logic that adds a one-week delay between each prompt of the location permission.

Workaround:

N/A

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

image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016f65004bf221326c
  • Upwork Job ID: 1826277541188173965
  • Last Price Increase: 2024-08-21
  • Automatic offers:
    • shubham1206agra | Reviewer | 103692549
    • Krishna2323 | Contributor | 103692550
Issue OwnerCurrent Issue Owner: @slafortune
@garrettmknight garrettmknight added Daily KSv2 NewFeature Something to build that is a new item. labels Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

Triggered auto assignment to @slafortune (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Aug 21, 2024

Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 21, 2024
@melvin-bot melvin-bot bot changed the title Use local Onyx key to throttle location permission prompts [$250] Use local Onyx key to throttle location permission prompts Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 21, 2024
Copy link
Contributor

@Krishna2323 Your proposal will be dismissed because you did not follow the proposal template.

@Krishna2323
Copy link
Contributor

Krishna2323 commented Aug 21, 2024

Edited by proposal-police: This proposal was edited at 2024-08-21 15:49:46 UTC.

Proposal

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

Use local Onyx key to throttle location permission prompts

What is the root cause of that problem?

New feat.

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

  • Create a ONYX key in this file.
  • Create a type for the ONYX entry in src/types/onyx. We will create a object that contains 2 properties, value and timeStamp.
  • Before calling setStartLocationPermissionFlow, we will check the ONYX object. If the value is false, we will directly call setStartLocationPermissionFlow. However, if it is true and the timestamp is not 7 days old, we will return without calling it. If the value is false and the timestamp is older than 7 days, we will update the timestamp and value and then call setStartLocationPermissionFlow.
    if (gpsRequired) {
    setStartLocationPermissionFlow(true);
    return;
    }
  • We can use differenceInDays to get the days passed from the timestamp.

NOTE: Every time we call setStartLocationPermissionFlow, we need to update the ONYX value and timestamp accordingly.

EDIT: Actually, we don't even need the value property, the timestamp will be enough to check the day passed and to determine when was the last time we asked the user about that.

What alternative solutions did you explore? (Optional)



Result

@nkdengineer
Copy link
Contributor

Proposal

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

Use local Onyx key to throttle location permission prompts

What is the root cause of that problem?

This is a new feature request

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

  1. Create an ONYXKEYS to store the last time we show the permission prompt
  2. Get the value of this key and before we show the location permission prompts in these places here, we will check if the last time the prompt opened is not 7 days old we will not process to show the current location prompt

if (gpsRequired) {
setStartLocationPermissionFlow(true);
return;

OPTIONAL: Since we can create Scan request in IOURequestStepScan via QAB, we also should add the location prompts in IOURequestStepConfirmation to IOURequestStepScan

  1. Then whenever we open the prompt here or here, update the ONYX value to update the time stamp.

What alternative solutions did you explore? (Optional)

NA

@Julesssss Julesssss self-assigned this Aug 21, 2024
@trjExpensify trjExpensify moved this to Release 2.5: SuiteWorld (Sept 9th) in [#whatsnext] #wave-collect Aug 23, 2024
@slafortune
Copy link
Contributor

Updated the steps to include submitting the receipt which needs to be done before the location services request populates.

@trjExpensify
Copy link
Contributor

@shubham1206agra what do you think about these proposals?

@melvin-bot melvin-bot bot added the Overdue label Aug 26, 2024
@shubham1206agra
Copy link
Contributor

@Krishna2323's proposal looks good to me.

🎀👀🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Aug 26, 2024
@slafortune
Copy link
Contributor

not deployed yet

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

This issue has not been updated in over 15 days. @Julesssss, @slafortune, @shubham1206agra, @Krishna2323 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!

@Julesssss
Copy link
Contributor

PR has had comments addressed and oday I requested an additional test for the prompt to reshow.

@Julesssss Julesssss added Weekly KSv2 Daily KSv2 and removed Monthly KSv2 Weekly KSv2 labels Oct 8, 2024
@Julesssss
Copy link
Contributor

Merged!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Oct 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] Use local Onyx key to throttle location permission prompts [HOLD for payment 2024-10-17] [$250] Use local Onyx key to throttle location permission prompts Oct 10, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

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

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

melvin-bot bot commented Oct 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.47-4 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 2024-10-17. 🎊

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

Copy link

melvin-bot bot commented Oct 10, 2024

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

  • [@shubham1206agra] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@slafortune] 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 Oct 17, 2024
@slafortune
Copy link
Contributor

So that I can process these payment - @shubham1206agra Please propose regression test steps to ensure the new feature will work correctly on production in further releases.

@melvin-bot melvin-bot bot added the Overdue label Oct 21, 2024
@Julesssss
Copy link
Contributor

Julesssss commented Oct 21, 2024

Waiting on regression test

@Julesssss
Copy link
Contributor

Julesssss commented Oct 21, 2024

We can use the test case I added to the PR QA steps.

@slafortune
Copy link
Contributor

@shubham1206agra looks like the original offer is expired - please accept the new offer I sent here

@melvin-bot melvin-bot bot removed the Overdue label Oct 21, 2024
@slafortune
Copy link
Contributor

@Krishna2323Paid ✅

@shubham1206agra
Copy link
Contributor

@slafortune Accepted

@slafortune
Copy link
Contributor

@shubham1206agra Paid ✅

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 Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
No open projects
Status: Release 2.5: SuiteWorld (Sept 9th)
Development

No branches or pull requests

9 participants