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-11-13] [$500] Bank - Calendar Is broken in Bank account flow #30792

Closed
2 of 6 tasks
lanitochka17 opened this issue Nov 2, 2023 · 36 comments
Closed
2 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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 2, 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!


Version Number: 1.3.95-0
**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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Access staging.new.expensify.com
  2. Sign into a valid account
  3. Go to Profile > Workspace > Connect to bank account
  4. Follow steps until you get to Step 2 of 5, where you can input "Incorporation date" in the calendar.
  5. Try and input any date, for example: 01/01/1980

Expected Result:

User expects to input the date with no problems

Actual Result:

The input is broken, the user is unable to input the correct date

Workaround:

Unknown

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

Add any screenshot/video evidence

Bug6261267_1698951136984.Calendar_feature_is_broken.mp4

Production:

Recording.1036.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f4c10e0e27ccfb95
  • Upwork Job ID: 1720165922139516928
  • Last Price Increase: 2023-11-02
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

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

Copy link

melvin-bot bot commented Nov 2, 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

@OSBotify
Copy link
Contributor

OSBotify commented Nov 2, 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.

Copy link

melvin-bot bot commented Nov 2, 2023

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

@conorpendergrast
Copy link
Contributor

Reproduced. Damn, that is indeed pretty bad

@conorpendergrast conorpendergrast added the External Added to denote the issue can be worked on by a contributor label Nov 2, 2023
@melvin-bot melvin-bot bot changed the title Bank - Calendar Is broken in Bank account flow [$500] Bank - Calendar Is broken in Bank account flow Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

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

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

melvin-bot bot commented Nov 2, 2023

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

@saranshbalyan-1234
Copy link
Contributor

working fine for me even on staging

@erquhart
Copy link
Contributor

erquhart commented Nov 2, 2023

Proposal

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

Month and day change while year is being entered in the incorporation date field of the Company Information form, so dates cannot be effectively typed and may only be selected via calendar picker widget.

What is the root cause of that problem?

Date is being parsed via new Date() - this changes the timezone and rolls the date back one day, turning 01/01/0001 to 12/31/0000. You can try this in your browser console by entering new Date('0001-01-01') to observe the result yourself.

Note: folks east of GMT (most non-US) may not see this bug because new Date() moves the timezone forward for their local time, so the date may not change. @saranshbalyan-1234 this may be why you're unable to repro.

This was introduced in the switch from moment to date-fns, where moment's moment() parser was replaced with new Date() instead of the date-fns parser parseISO(): https://github.com/Expensify/App/pull/29984/files#diff-6b255c40f9440d083c61f6b75caa0c2ad388438ea8fd18eefb410746b1e955f6

Observe the logs I'm printing to the console as the bug occurs (also pasted a sample below):

Screen.Recording.2023-11-02.at.4.28.42.PM.mov

The first log, when the "1" in "1980" is entered, is this (added line breaks for readability):

text: 0001-01-01
parsed date: Sun Dec 31 0000 19:03:58 GMT-0456 (Eastern Standard Time)
formatted date: 0001-12-31

So the current process goes:

  • user enters month and date
  • user enters first digit in year
  • at this point the date is technically valid (eg., 01/01/0001)
  • the date is parsed and formatted because it is valid
  • new Date() effectively converts 01/01/0001 to 12/31/0000 because timezones (parsed date in the logs above)
  • the formatted date becomes 0001-12-31 - this is why the day and month are changing as the year is being entered

The corrected process:

  • user enters month and date
  • user enters first digit in year
  • at this point the date is technically valid (eg., 01/01/0001)
  • the date is parsed and formatted because it is valid
  • parseISO() converts the string to a javascript date without interpreting timezone, so the month and day don't change

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

Use date-fns parseISO() to parse the date without introducing timezone differences.

This may need to be applied anywhere that the moment() function was swapped for new Date() for parsing dates from strings. I can look at other areas as a part of this fix if need be, but I stayed in scope for now to limit my investment at the proposal stage.

I'm ready to get a fix in right away as this is blocking deploys.

Tested locally:

Screen.Recording.2023-11-02.at.4.24.37.PM.mov

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@mountiny
Copy link
Contributor

mountiny commented Nov 3, 2023

Seems like a regression from a PR from @allroundexperts and @waterim asking if they can raise a fix

@erquhart
Copy link
Contributor

erquhart commented Nov 3, 2023

@mountiny okay - is there anything for my effort on root cause and providing a solution? I did see that it was a regression from that PR and it's linked in my proposal.

@mountiny
Copy link
Contributor

mountiny commented Nov 3, 2023

Yeah we would pay you for your efforts if you solution will be used

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Hourly KSv2 labels Nov 3, 2023
@erquhart
Copy link
Contributor

erquhart commented Nov 6, 2023

@conorpendergrast just sent, thanks for your help.

The payment for me is because my proposal was used by another engineer, as they fixed it as a regression. My comment above was only to point out that I'm still helping out with other places the same bug has popped up, in case that's relevant.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] Bank - Calendar Is broken in Bank account flow [HOLD for payment 2023-11-13] [$500] Bank - Calendar Is broken in Bank account flow Nov 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

Copy link

melvin-bot bot commented Nov 6, 2023

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

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:

Copy link

melvin-bot bot commented Nov 6, 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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@conorpendergrast] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mountiny
Copy link
Contributor

mountiny commented Nov 7, 2023

@erquhart thanks! We still wait for the PR to hit production +7 days regression perioed before we pay out, even if your solution helped and you havent implemented it

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Nov 13, 2023
@conorpendergrast
Copy link
Contributor

@erquhart Oh hey Shawn! Please could you apply for this job, so that I can pay you $125? Thanks!

@conorpendergrast
Copy link
Contributor

@allroundexperts C+ checklist please!

@erquhart
Copy link
Contributor

@conorpendergrast sent, thank you!

@conorpendergrast
Copy link
Contributor

@erquhart Contract sent!

@conorpendergrast
Copy link
Contributor

conorpendergrast commented Nov 15, 2023

Payouts due:

Upwork job is here.

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Nov 15, 2023

This is regression from #29984

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@mountiny
Copy link
Contributor

@conorpendergrast has this been paid out then, can we close this?

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2023
@erquhart
Copy link
Contributor

@mountiny I can confirm I have been paid, and I'm the only one on the list.

@conorpendergrast
Copy link
Contributor

Yep, it has been paid, but the C+ checklist is outstanding for @allroundexperts I think (hence why I haven't closed this yet)

@allroundexperts
Copy link
Contributor

@conorpendergrast The checklist isn't needed here I think since this was a regression of an issue which was in the payment hold period.

@conorpendergrast
Copy link
Contributor

Right, and it was caught via Applause by a regression test. Ok, thanks for making that clear! Closing out, we did it, hooray

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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

9 participants