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-12] [HOLD for payment 2023-10-10] [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown #28690

Closed
3 of 6 tasks
izarutskaya opened this issue Oct 3, 2023 · 28 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Oct 3, 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. Launch app
  2. Tap fab
    3.Tap request money
  3. Enter an amount
  4. Tap next
  5. Select any user
  6. Tap request amount
  7. Open IOU report page
  8. Note date and merchant field is not shown
  9. Tap date field and select any date eg:"oct 1 or oct 2"
  10. Tap save

Expected Result:

App must not crash when user saves the selected date. Merchant and date field must be shown.

Actual Result:

App crashes when user saves the selected date. Merchant and date field is not shown.

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.76-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

Notes/Photos/Videos: Any additional supporting documentation

Bug6222780_1696309566697.ancrash.mp4

utest-dl.s3.amazonaws.com_12102_26469_432782_6222780_bugAttachment_Bug6222780_1696309387236%21crash.txt_X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20231003T081930Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAJ.txt

Expensify/Expensify Issue URL:

Issue reported by: Applause-Internal Team

Slack conversation: @

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014620b7473ef96d10
  • Upwork Job ID: 1709122266335506432
  • Last Price Increase: 2023-10-03
  • Automatic offers:
    • mollfpr | Reviewer | 26995484
    • namhihi237 | Contributor | 26995485
    • aimane-chnaif | Contributor | 26996114
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment 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 Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@melvin-bot melvin-bot bot changed the title Android- IOU-App crashes when saving the selected date & merchant/date field not shown [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

Job added to Upwork: https://www.upwork.com/jobs/~014620b7473ef96d10

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 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 Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@OSBotify
Copy link
Contributor

OSBotify commented Oct 3, 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 Oct 3, 2023

Current assignee @puneetlath is eligible for the Engineering assigner, not assigning anyone new.

@izarutskaya
Copy link
Author

Production video

Screen_Recording_20231003_123400_New.Expensify.mp4

@namhihi237
Copy link
Contributor

namhihi237 commented Oct 3, 2023

Proposal

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

App crashes when updating the date IOU

What is the root cause of that problem?

This issue was introduced from PR
We have a crash because here

App/src/libs/ReportUtils.js

Lines 1633 to 1637 in 53ee975

const hasModifiedCreated = _.has(reportActionOriginalMessage, 'oldCreated') && _.has(reportActionOriginalMessage, 'created');
if (hasModifiedCreated) {
// Take only the YYYY-MM-DD value as the original date includes timestamp
let formattedOldCreated = parseISO(reportActionOriginalMessage.oldCreated);
formattedOldCreated = format(formattedOldCreated, CONST.DATE.FNS_FORMAT_STRING);

Because oldCreated has an empty value, it leads to formattedOldCreated invalid date, leading to the app crash.

The reason oldCreated is because when creating IOU, in MoneyRequestView we get created which returns empty even though it has value

const {
created: transactionDate,
amount: transactionAmount,
currency: transactionCurrency,
comment: transactionDescription,
merchant: transactionMerchant,
billable: transactionBillable,
category: transactionCategory,
tag: transactionTag,
} = ReportUtils.getTransactionDetails(transaction);

We get date here:

function getCreated(transaction: Transaction): string {
const created = transaction?.modifiedCreated ?? transaction?.created ?? '';
const createdDate = parseISO(created);
if (isValid(createdDate)) {
return format(createdDate, CONST.DATE.FNS_FORMAT_STRING);
}

The problem is that it returns empty even though created has a value:

const created = transaction?.modifiedCreated ?? transaction?.created ?? '';

The reason is that the nullish coalescing operator (??) will only return the value on the right if the value on the left is null or undefined. In this case, transaction?.modifiedCreated is an empty string "", but is not null or undefined, so it does not trigger the ?? operator. Instead, it returns the value of transaction?.modifiedCreated, i.e. "".

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

We should update the getCreated logic:

const created = (transaction?.modifiedCreated !== "" ? transaction?.modifiedCreated : transaction?.created) ?? '';

Or

const created = transaction?.modifiedCreated || transaction?.created || '';

What alternative solutions did you explore? (Optional)

N/A

@shubham1206agra
Copy link
Contributor

@namhihi237 Since this is a deploy blocker. Please link the offending PR

@mountiny
Copy link
Contributor

mountiny commented Oct 3, 2023

@namhihi237 Great!

const created = transaction?.modifiedCreated || transaction?.created || '';

I like this more, can you please raise a PR? Also this null coallescing logic might have been worng for other modified fields, lets make sure that is fixed too

Can you raise a PR now?

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

melvin-bot bot commented Oct 3, 2023

📣 @mollfpr 🎉 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 Oct 3, 2023

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

Offer link
Upwork job
Please accept the offer 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 📖

@namhihi237
Copy link
Contributor

@mountiny yes I will raise PR asap.

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

📣 @aimane-chnaif 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

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

melvin-bot bot commented Oct 3, 2023

🎯 ⚡️ Woah @aimane-chnaif / @namhihi237, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @namhihi237 got assigned: 2023-10-03 09:46:24 Z
  • when the PR got merged: 2023-10-03 14:03:33 UTC

On to the next one 🚀

@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Oct 3, 2023
@mountiny
Copy link
Contributor

mountiny commented Oct 3, 2023

Fixed
image

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 3, 2023
@melvin-bot melvin-bot bot changed the title [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown [HOLD for payment 2023-10-10] [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown Oct 3, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

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 3, 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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [@puneetlath] 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 5, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-10] [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown [HOLD for payment 2023-10-12] [HOLD for payment 2023-10-10] [$500] Android- IOU-App crashes when saving the selected date & merchant/date field not shown Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

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 5, 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:

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

@puneetlath
Copy link
Contributor

@aimane-chnaif friendly reminder for checklist.

@aimane-chnaif
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: [No QA] [TS migration] Migrate 'TransactionUtils.js' lib to TypeScript #28005
  • 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: https://github.com/Expensify/App/pull/28005/files#r1343835629
  • 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: N/A
  • Determine if we should create a regression test for this bug. N/A as this was caught by Applause team, I think this regression test already exists
  • 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. N/A No need duplicated regression test

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

@puneetlath, @mountiny, @namhihi237, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

@puneetlath
Copy link
Contributor

All paid. Thanks everyone!

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
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

8 participants