Skip to content

[HOLD 67823][$250] [ORTF] - report:created and report:startdate not optimistically computed #68803

Closed

Description

@lanitochka17

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: 9.1.97-1
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from TestRail: #65862
Email or phone of affected tester (no customers): applausetester+ag1908.2@applause.expensifail.com
Issue reported by: Applause - Internal Team

Set up

  1. Follow the pre-testing steps in the manual test document

Action Performed:

  1. Log into new expensify

  2. Go to workspace settings > Reports

  3. Click Default report title

  4. Edit the Default report title field with:
    Created {report:created} vs Started {report:startdate}

  5. Save the new title

  6. Create a new report via FAB

  7. Add an expense with a date before the report was created

Expected Result:

After steps 6 and 7 the report name should be computed properly

Actual Result:

After step 6 the report name is set to the un-computed formula until the backend responds. After step 7, the name remains unchanged until the backend responds

Workaround:

Unknown

Platforms:

All

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
2025-09-12_08-27-39.mp4
2025-09-12_08-30-46.mp4
Backend implementation
    if (partName == "created" || partName == "createddate" || partName == "createdate") {
        return Formula::getFormattedDateForPart(db, fieldPath, reportJSON.getStringMemberWithDefault("created", ""), "yyyy-MM-dd HH:mm:ss");
    }
    if (partName == "startdate" || partName == "enddate") {
        const string date = Report::getTransactionCreatedDate(db, reportID, partName == "enddate");
        return Formula::getFormattedDateForPart(db, fieldPath, date);
    }
string Report::getTransactionCreatedDate(SQLite& db, const int64_t reportID, const bool forMostRecentTransaction, const string& defaultDate)
{
    // Get the most or least recent created date from the report transactions, excluding partial transactions
    const string transactionCreated = DB::read(db,
        "SELECT COALESCE(modifiedCreated, created) AS transactionCreated "
        "FROM transactions "
        "WHERE reportID > 0 "
        "  AND reportID = " + SQ(reportID) + " "
        "  AND (COALESCE(modifiedAmount, amount) != " + to_string(Transaction::PARTIAL_AMOUNT) + " OR COALESCE(NULLIF(modifiedMerchant, ''), merchant) != " + SQ(Transaction::PARTIAL_MERCHANT) + ") "
        "ORDER BY transactionCreated " + (forMostRecentTransaction ? "DESC" : "ASC") + " "
        "LIMIT 1;"
    );
    return transactionCreated.empty() ? defaultDate : transactionCreated;
}
    /**
     * Get the created date of the most recent transaction on a report, otherwise the created date of the oldest transaction.
     * If the report has no transactions, return the default date.
     */
    static string getTransactionCreatedDate(SQLite& db, const int64_t reportID, const bool forMostRecentTransaction, const string& defaultDate = SComposeTime("%Y-%m-%d", STimeNow()));
    static constexpr auto PARTIAL_AMOUNT = 0;
    static constexpr auto PARTIAL_MERCHANT = "(none)";

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021966528082461829129
  • Upwork Job ID: 1966528082461829129
  • Last Price Increase: 2025-09-19
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @neil-marcellini

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Aug 19, 2025
  2. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    Triggered auto assignment to @alexpensify (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.

  3. github-actions commented on Aug 19, 2025

    @github-actions
    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.
  4. melvin-bot commented on Aug 19, 2025

    @melvin-bot

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

  5. melvin-bot commented on Aug 19, 2025

    @melvin-bot

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

  6. nkuoch commented on Aug 20, 2025

    @nkuoch
    Contributor

    cc @NikkiWines as you've recently worked on some formula parsing I believe?

  7. nkuoch commented on Aug 20, 2025

    @nkuoch
    Contributor
  8. nkuoch commented on Aug 20, 2025

    @nkuoch
    Contributor

    Removing Deployblockercash label as it seems to be backend anyway

  9. 80 remaining items

  10. melvin-bot commented on Nov 4, 2025

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (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.

  11. added
    Daily
    and removed
    Weekly
    on Nov 4, 2025
  12. mallenexpensify commented on Nov 4, 2025

    @mallenexpensify
    Contributor

    @brianlee-expensify plz take over as BZ, thx

  13. melvin-bot commented on Nov 7, 2025

    @melvin-bot

    @neil-marcellini, @ahmedGaber93, @brianlee-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. brianlee-expensify commented on Nov 14, 2025

    @brianlee-expensify
    Contributor

    for context:

    1. waiting on this GH to get deployed...
    2. which will then unblock this GH...
    3. which will then unblock this GH...
    4. which will then unblock this current GH
  15. added
    Weekly
    and removed
    Daily
    on Nov 27, 2025
  16. melvin-bot commented on Nov 27, 2025

    @melvin-bot

    This issue has not been updated in over 14 days. @neil-marcellini, @ahmedGaber93, @brianlee-expensify eroding to Weekly issue.

  17. neil-marcellini commented on Dec 1, 2025

    @neil-marcellini
    Contributor

    We have now decided that this behavior is acceptable, and we can just rely on the backend to compute it, as explained here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringExternalHelp WantedWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions