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-09-29] [$2000] Web - user not able to save last enable date of birth #24266

Closed
1 of 6 tasks
mvtglobally opened this issue Aug 8, 2023 · 72 comments
Closed
1 of 6 tasks
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

Comments

@mvtglobally
Copy link

mvtglobally commented Aug 8, 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. Set the Date & Time on your Mac to India Standard Time
    a. On Mac > System Settings > General > Date & Time
    b. Enable "set time and date automatically" & Disable "Set time zone automatically using your current location"
    c. Choose New Delhi - India as your "Closest City"
    d. Disable "set time and date automatically"

  2. Sign into https://staging.new.expensify.com/settings on the Chrome browser

  3. Click the Profile icon (settings) > Profile > Personal details > Date of birth

  4. Select the most recent available date

  5. Notice date error

Expected Result:

user should able to save enable date

Actual Result:

error appears on select latest enable date

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: v1.3.53-1
Reproducible in staging?: Y
Reproducible in production?: N
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

Screen.Recording.2023-08-08.at.6.09.45.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan & @Pujan92
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691498421013379

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011fd6c960bd909251
  • Upwork Job ID: 1689782476244590592
  • Last Price Increase: 2023-08-24
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26685187
    • gadhiyamanan | Reporter | 26685188
@mvtglobally mvtglobally added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 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

@mvtglobally
Copy link
Author

I wasn't able to reproduce, Not sure if this is account specific. Since its potential blocker, please double check

@OSBotify
Copy link
Contributor

OSBotify commented Aug 8, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

Triggered auto assignment to @Gonals (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@gadhiyamanan
Copy link
Contributor

Try with new user if not able to reproduce

@c3024
Copy link
Contributor

c3024 commented Aug 8, 2023

Proposal

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

Selecting last enabled date of birth shows error

What is the root cause of that problem?

We recently updated to date-fns in getAgeRequirementError but we changed the currenDate to start of the day here

const currentDate = startOfDay(new Date());

so currentDate here starts at 00:00 GMT and
testdate here takes the corresponding zone time here +05:30

const testDate = new Date(date);

so it gives an error

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

We should change this to

const currentDate =new Date();

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Hourly KSv2 labels Aug 8, 2023
@Nodebrute
Copy link
Contributor

Nodebrute commented Aug 8, 2023

Proposal

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

Web - user not able to save last enable date of birth

What is the root cause of that problem?

This code block gets triggered

if (isSameDay(testDate, recentDate) || isAfter(testDate, recentDate)) {
return ['privatePersonalDetails.error.dateShouldBeBefore', {dateString: format(recentDate, CONST.DATE.FNS_FORMAT_STRING)}];
}

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

We can change maxDate to this in DateOfBirthPage
maxDate={moment().subtract(CONST.DATE_BIRTH.MIN_AGE, 'years').subtract(1, 'days').toDate()}

or We can fix it directly in getAgeRequirementError By changing recentDate

const recentDate = addDays(subYears(currentDate, minimumAge), 1)

or we can use date-fns to set maxDate to one day before so we don't have same day error.

What alternative solutions did you explore? (Optional)

@Pujan92
Copy link
Contributor

Pujan92 commented Aug 8, 2023

Proposal

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

Not able to select the max date for non UTC timezone users

What is the root cause of that problem?

Here we have the difference in time which causes this condition isWithinInterval to be falsy. We are comparing the currentDate with the start time of day with testDate without the start time of the day which won't make the testDate in within the interval and it passed that if block.

if (isWithinInterval(testDate, {start: longAgoDate, end: recentDate})) {

Screenshot 2023-08-08 at 7 54 51 PM

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

We need to add startOfDay for the testDate also to compare the dates correctly which considers the correct timestamp.

const testDate = startOfDay(new Date(date));

const testDate = new Date(date);

@Christinadobrzyn
Copy link
Contributor

I can't reproduce either - asking for more guidance in the Slack thread - https://expensify.slack.com/archives/C049HHMV9SM/p1691509966704559?thread_ts=1691498421.013379&cid=C049HHMV9SM

@puneetlath
Copy link
Contributor

I don't think this needs to be a deploy blocker as it only affects users who are exactly 5 years old. Removing the label.

@puneetlath puneetlath removed the DeployBlockerCash This issue or pull request should block deployment label Aug 8, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Aug 8, 2023

I can't reproduce either - asking for more guidance in the Slack thread -

@Christinadobrzyn It can be reproducible for the GMT+ timezones. for GMT- it won't be reproducible as it(current code) considers previous day for the error condition.

@Pujan92
Copy link
Contributor

Pujan92 commented Aug 9, 2023

For Mac these are the steps to update timezone and set any GMT+ city.

  1. Select "System Preferences" from the Apple menu.
  2. Under the "Date and Time" option, click on "Time Zone."
  3. Deselect the "Set Time Zone Automatically Using Current Location" and update the city manually.
Screen.Recording.2023-08-09.at.5.13.33.PM.mp4

@melvin-bot melvin-bot bot added the Overdue label Aug 10, 2023
@Christinadobrzyn Christinadobrzyn added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Aug 10, 2023
@melvin-bot melvin-bot bot changed the title Web - user not able to save last enable date of birth [$1000] Web - user not able to save last enable date of birth Aug 10, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @0xmiroslav 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @gadhiyamanan 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@blazejkustra
Copy link
Contributor

@0xmiroslav The PR is ready for review!

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 labels Sep 15, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Web - user not able to save last enable date of birth [HOLD for payment 2023-09-29] [$2000] Web - user not able to save last enable date of birth Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-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-09-29. 🎊

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 Sep 22, 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@Christinadobrzyn] 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 Sep 29, 2023
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Sep 29, 2023

@0xmiroslav is there a regression for this? Let me know and I'll pay this out

Payouts will be:

Issue Reporter: $250 @gadhiyamanan (old pricing)
Contributor: NA @blazejkustra (contractor)
Contributor+: $2000 + $1000 bonus @0xmiroslav (old pricing)

Eligible for 50% #urgency bonus? Y - #24266 (comment)

Upwork job is here.

@0xmiros
Copy link
Contributor

0xmiros commented Sep 29, 2023

Contributor was assigned on Sep 14
C+ approved on Sep 16
PR merged on Sep 18 without changes requested
Sep 16, 17 was weekend

So I'd say actual timeline is within 2 days

@0xmiros
Copy link
Contributor

0xmiros commented Sep 29, 2023

No need regression test.
This is super edge case. No one will likely to select their age as 5 (min) or 150 (max).

@Christinadobrzyn
Copy link
Contributor

@gadhiyamanan it looks like you might need to accept the offer - https://www.upwork.com/jobs/~011fd6c960bd909251
@0xmiroslav let me know how you'd like to be paid. Is this your new profile? https://www.upwork.com/nx/wm/offer/26685187

@0xmiros
Copy link
Contributor

0xmiros commented Sep 29, 2023

@gadhiyamanan
Copy link
Contributor

@Christinadobrzyn offer accepted, thanks!

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@Gonals
Copy link
Contributor

Gonals commented Oct 2, 2023

All done here?

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Oct 3, 2023

Sorry for the delay here -

@gadhiyamanan I've paid you in Upwork based on this payment structure.

@0xmiroslav thanks for the Slack link it sounds like your Upwork account has been restored and we're paying you directly.

What is the Upwork link for your restored account so I can pay you through Upwork for this? Thanks!

@0xmiros
Copy link
Contributor

0xmiros commented Oct 3, 2023

@Christinadobrzyn please hold my payment yet and just close the issue. I am tracking myself and will ping here once ready.

@Christinadobrzyn
Copy link
Contributor

Okay sounds good! Closing for now @0xmiroslav please let me know if you need any help with payment in the future.

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
Projects
None yet
Development

No branches or pull requests