Skip to content

[Due for payment 2026-05-29] [$250] Report - Cannot change report titles in NewDot #84555

Closed

Description

@izarutskaya

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:
Reproducible in staging?: Needs Reproduction (All the steps described in the issue were followed, but the bug did not occur)
Reproducible in production?: Needs Reproduction (All the steps described in the issue were followed, but the bug did not occur)
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @GeoVasile
Slack conversation (hyperlinked to channel name): expensify_bugs

Action Performed:

  1. Open the report
  2. Click on the report title
  3. Click on the report title again

Expected Result:

This should allow the user to change it

Actual Result:

They receive an "It's not here" error

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Image

Check the OP for the customer details.

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022030962642924822963
  • Upwork Job ID: 2030962642924822963
  • Last Price Increase: 2026-03-09
  • Automatic offers:
    • aimane-chnaif | Reviewer | 111482615

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 9, 2026
  2. melvin-bot commented on Mar 9, 2026

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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. MelvinBot commented on Mar 9, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a user opens an expense report and clicks the report title (to edit it), they see the "Hmm... it's not here" error page instead of the title edit form. This happens on certain workspace configurations where the title field is absent from the policy's field list.

    What is the root cause of that problem?

    The canEditReportTitle function in App/src/libs/ReportUtils.ts:4511-4516 does not verify that a title field was actually found before returning true:

    function canEditReportTitle(report, policy) {
        const titleField = getAvailableReportFields(report, Object.values(policy?.fieldList ?? {}))
            .find(isReportFieldOfTypeTitle);
        const isFieldDisabled = isReportFieldDisabled(report, titleField, policy);
        //                                                     ^^^^^^^^^^
        // titleField can be undefined here, but isReportFieldDisabled(report, undefined, policy)
        // returns false for non-settled/non-closed expense reports — so the function returns true
        // even though there is no title field to edit.
    
        return !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy)
            && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
    }

    When titleField is undefined, isReportFieldDisabled(report, undefined, policy) falls through its checks and returns false (because isReportFieldOfTypeTitle(undefined) is false, and undefined?.type === FORMULA is also false). So canEditReportTitle returns true even when no title field exists.

    This causes the edit button (pencil icon on wide screens) or the clickable title on the report details page to appear. When the user clicks through to EditReportFieldPage, the page tries to look up the title field from report.fieldList and policy.fieldList. Since neither has it, the fallback at getTitleFieldWithFallback returns undefined (because the policy has other fields, so isPolicyFieldListEmpty returns false). The guard at line 80 fires (!reportField is true) and the "It's not here" page is shown.

    This explains why the bug is customer-specific and hard to reproduce — it requires a paid group policy where the title field (text_title) is absent from the field list while other custom report fields exist.

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

    Add a !!titleField check to canEditReportTitle in App/src/libs/ReportUtils.ts:

    function canEditReportTitle(report, policy) {
        const titleField = getAvailableReportFields(report, Object.values(policy?.fieldList ?? {}))
            .find(isReportFieldOfTypeTitle);
        const isFieldDisabled = isReportFieldDisabled(report, titleField, policy);
    
        return !!titleField && !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy)
            && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
    }

    This prevents the edit button/link from appearing when there is no title field, so the user never navigates to EditReportFieldPage in a state that will show "It's not here".

    What alternative solutions did you explore? (Optional)

    1. Fix EditReportFieldPage to handle missing title field gracefully — e.g., always use FALLBACK_TITLE_FIELD even when the policy has other fields. This would let users edit the title regardless of policy configuration, but it may not match intended behavior if an admin intentionally removed the title field.

    2. Fix isReportFieldDisabled to return true for undefined fields — This would be more defensive but could have unintended side effects in other callers that pass undefined fields.

    The proposed fix (option in the main section) is the most targeted and safe approach.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 9, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 9, 2026
  6. melvin-bot commented on Mar 9, 2026

    @melvin-bot

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

  7. melvin-bot commented on Mar 9, 2026

    @melvin-bot
  8. changed the title [-]Report - Cannot change report titles in NewDot[/-] [+][$250] Report - Cannot change report titles in NewDot[/+] on Mar 9, 2026
  9. mukhrr commented on Mar 9, 2026

    @mukhrr
    Contributor

    Proposal

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

    When a user opens an expense report on a paid group policy workspace and clicks the report title to edit it, they are navigated to the edit page which shows an "It's not here" error instead of the title edit form. This prevents users from changing expense report titles in NewDot.

    What is the root cause of that problem?

    The canEditReportTitle function does not verify that a title field actually exists before determining editability.

    App/src/libs/ReportUtils.ts

    Lines 4511 to 4516 in 43a57cf

    function canEditReportTitle(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
    const titleField = getAvailableReportFields(report, Object.values(policy?.fieldList ?? {})).find((reportField) => isReportFieldOfTypeTitle(reportField));
    const isFieldDisabled = isReportFieldDisabled(report, titleField, policy);
    return !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy) && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
    }

    When titleField is undefined (i.e., the policy's fieldList does not contain a title field), isReportFieldDisabled(report, undefined, policy) returns false because isReportFieldOfTypeTitle(undefined) is false, so it skips the title-specific check, and undefined?.type === FORMULA is also false.

    App/src/libs/ReportUtils.ts

    Lines 4472 to 4490 in 43a57cf

    function isReportFieldDisabled(report: OnyxEntry<Report>, reportField: OnyxEntry<PolicyReportField>, policy: OnyxEntry<Policy>): boolean {
    if (isInvoiceReport(report)) {
    return true;
    }
    const isReportSettled = isSettled(report?.reportID);
    const isReportClosed = isClosedReport(report);
    const isTitleField = isReportFieldOfTypeTitle(reportField);
    const isAdmin = isPolicyAdmin(policy);
    const isApproved = isReportApproved({report});
    if (!isAdmin && (isReportSettled || isReportClosed || isApproved)) {
    return true;
    }
    if (isTitleField) {
    return !reportField?.deletable;
    }
    return reportField?.type === CONST.REPORT_FIELD_TYPES.FORMULA;
    }

    This means canEditReportTitle returns true even when no title field exists in the policy. The report details page then renders an interactive/clickable title that navigates to EditReportFieldPage. On that page, the title field lookup fails — report.fieldList and policy.fieldList both lack the field, and getTitleFieldWithFallback returns undefined because the policy has other fields (so isPolicyFieldListEmpty is false).

    App/src/libs/ReportUtils.ts

    Lines 4528 to 4539 in 43a57cf

    function getTitleFieldWithFallback(policy: OnyxEntry<Policy>): PolicyReportField | undefined {
    const policyTitleField = policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE];
    if (policyTitleField) {
    return policyTitleField;
    }
    if (isPolicyFieldListEmpty(policy)) {
    return FALLBACK_TITLE_FIELD;
    }
    return undefined;
    }

    The guard on line 80 of EditReportFieldPage then fires (!reportField is true) and renders FullPageNotFoundView.

    if (!reportFieldsEnabled || !reportField || !policyField || !report || isDisabled) {
    return (
    <ScreenWrapper
    includeSafeAreaPaddingBottom={false}
    shouldEnableMaxHeight
    testID="EditReportFieldPage"
    >
    <FullPageNotFoundView shouldShow />
    </ScreenWrapper>
    );

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

    1. Add a !!titleField guard to canEditReportTitle so the edit UI is only shown when a title field actually exists in the policy:

      App/src/libs/ReportUtils.ts

      Lines 4511 to 4516 in 43a57cf

      function canEditReportTitle(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
      const titleField = getAvailableReportFields(report, Object.values(policy?.fieldList ?? {})).find((reportField) => isReportFieldOfTypeTitle(reportField));
      const isFieldDisabled = isReportFieldDisabled(report, titleField, policy);
      return !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy) && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
      }
    --- a/src/libs/ReportUtils.ts
    +++ b/src/libs/ReportUtils.ts
    @@ -4511,7 +4511,7 @@ function canEditReportTitle(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>
         const titleField = getAvailableReportFields(report, Object.values(policy?.fieldList ?? {})).find((reportField) => isReportFieldOfTypeTitle(reportField));
         const isFieldDisabled = isReportFieldDisabled(report, titleField, policy);
    
    -    return !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy) && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
    +    return !!titleField && !isFieldDisabled && isAdminOwnerApproverOrReportOwner(report, policy) && isExpenseReport(report) && isPaidGroupPolicyPolicyUtils(policy);
     }

    This is a one-line fix that prevents the clickable title from appearing when there is no title field to edit, so users never reach the not-found page.

  10. MelvinBot commented on Mar 9, 2026

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  11. 72 remaining items

  12. melvin-bot commented on May 22, 2026

    @melvin-bot

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

    For reference, here are some details about the assignees on this issue:

  13. melvin-bot commented on May 22, 2026

    @melvin-bot

    @aimane-chnaif @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. aimane-chnaif commented on May 25, 2026

    @aimane-chnaif
    Contributor

    @MelvinBot What is offending PR?

  15. MelvinBot commented on May 25, 2026

    @MelvinBot
    Contributor

    The offending PR is #80254 — "[No QA] Allow editing report titles if title field is missing", merged on 2026-02-11.

    That PR introduced getTitleFieldWithFallback and modified canEditReportTitle but didn't guard against titleField being undefined when the policy has other custom fields but no text_title entry, which is the exact condition that causes the "It's not here" error.

  16. aimane-chnaif commented on May 25, 2026

    @aimane-chnaif
    Contributor

    BugZero Checklist:

    • [Contributor] 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: [No QA] Allow editing report titles if title field is missing #80254 (comment)

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/642784

    Regression Test Proposal

    Test:

    1. Log in with an account that has a workspace on a Collect or Control plan
    2. Go to Workspace > Reports > Report Fields and ensure the workspace has at least one custom report field but no title field (text_title)
    3. Create an expense report under that workspace
    4. Tap/click the report title
    5. Verify the title edit page opens (previously showed "It's not here")
    6. Change the title and save — verify it persists

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-8c05-abb4-6db4-c23c4f5d36b4
  17. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 25, 2026
  18. melvin-bot commented on May 28, 2026

    @melvin-bot

    Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.

  19. mallenexpensify commented on May 29, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif paid $250 via Upwork

    ^ Test case created. Thx

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNeeds ReproductionReproducible steps needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions