Skip to content

[Better Expense Report View] Track expense - Content before dot separator is empty when track expense is deleted offline #60087

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

Open
6 of 8 tasks
mitarachim opened this issue Apr 11, 2025 · 15 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented Apr 11, 2025

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: 9.1.27-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp #59811
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  • Account has self DM.(please try Create an unreported expense on OD to trigger self DM in ND).
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Track a manual expense in self DM.
  4. Go offline.
  5. Right click on the expense preview > Delete expense.
  6. Delete the expense.

Expected Result:

The date in the expense preview will not disappear when track expense is deleted offline.

Actual Result:

The date in the expense preview disappears when track expense is deleted offline. This results in empty content before the dot separator in the expense preview.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Image
Bug6799008_1744339321508.20250411_103443.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @allgandalf
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Apr 11, 2025
Copy link

melvin-bot bot commented Apr 11, 2025

Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 11, 2025

Triggered auto assignment to @RachCHopkins (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Apr 11, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 11, 2025
Copy link
Contributor

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

@daledah
Copy link
Contributor

daledah commented Apr 11, 2025

Proposal

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

The date in the expense preview disappears when track expense is deleted offline. This results in empty content before the dot separator in the expense preview.

What is the root cause of that problem?

transaction in here is undefined, but isCreatedMissing still returns false

function isCreatedMissing(transaction: OnyxEntry<Transaction>) {
return transaction?.created === '' && (!transaction.created || transaction.modifiedCreated === '');
}

It leads to unshift dotSeparator to previewHeaderText without date

if (!isCreatedMissing(transaction)) {
const created = getFormattedCreated(transaction);
const date = DateUtils.formatWithUTCTimeZone(created, DateUtils.doesDateBelongToAPastYear(created) ? CONST.DATE.MONTH_DAY_YEAR_ABBR_FORMAT : CONST.DATE.MONTH_DAY_ABBR_FORMAT);
previewHeaderText.unshift({text: date}, dotSeparator);
}

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

We should return true in function isCreatedMissing when we don't have transaction

function isCreatedMissing(transaction: OnyxEntry<Transaction>) {
    if (!transaction) {
        return true;
    }
    return transaction?.created === '' && (!transaction.created || transaction.modifiedCreated === '');
}

function isCreatedMissing(transaction: OnyxEntry<Transaction>) {
return transaction?.created === '' && (!transaction.created || transaction.modifiedCreated === '');
}

Image

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

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.

@daledah
Copy link
Contributor

daledah commented Apr 11, 2025

@techievivek @RachCHopkins i can help to raise a quick PR if needed

@luacmartins luacmartins removed the DeployBlocker Indicates it should block deploying the API label Apr 11, 2025
@techievivek
Copy link
Contributor

This seems related to the #59811?

@techievivek
Copy link
Contributor

techievivek commented Apr 14, 2025

Should be safe to demote this as it's a very typical flow and needs deletion of expense in offline.

@techievivek techievivek added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 14, 2025
@mountiny mountiny changed the title Track expense - Content before dot separator is empty when track expense is deleted offline [Better Expense Report View] Track expense - Content before dot separator is empty when track expense is deleted offline Apr 14, 2025
@techievivek techievivek assigned mountiny and unassigned techievivek Apr 14, 2025
@mountiny mountiny moved this to Second Cohort - CRITICAL in [#whatsnext] #migrate Apr 14, 2025
@Guccio163
Copy link
Contributor

Guccio163 commented Apr 14, 2025

@daledah's solution seems OK, but I'd wait for @JakubKorytko's opinion, since he created this 👆

@JakubKorytko
Copy link
Contributor

LGTM

@mountiny mountiny assigned daledah and unassigned Guccio163 Apr 14, 2025
@mountiny
Copy link
Contributor

@daledah can you please raise a PR? Thanks!

@daledah
Copy link
Contributor

daledah commented Apr 14, 2025

I'll raise a PR in a few hours

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 14, 2025
@melvin-bot melvin-bot bot removed the Weekly KSv2 label May 8, 2025
Copy link

melvin-bot bot commented May 8, 2025

This issue has not been updated in over 15 days. @RachCHopkins, @mountiny, @allgandalf, @daledah 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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label May 8, 2025
@RachCHopkins RachCHopkins added Weekly KSv2 and removed Monthly KSv2 labels May 9, 2025
@RachCHopkins
Copy link
Contributor

Conversations are ongoing in PR thread.

@trjExpensify trjExpensify moved this from Second Cohort - CRITICAL to Second Cohort - MEDIUM or LOW in [#whatsnext] #migrate May 9, 2025
@allgandalf
Copy link
Contributor

Should get merged this week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2
Projects
Status: Second Cohort - MEDIUM or LOW
Development

No branches or pull requests

9 participants