Skip to content

[Due for payment 2025-12-04] [$250] Reports - Default report title field accepts multiline title and renders mark down #74899

Closed

Description

@mitarachim

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.2.49-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exp https://test-management.browserstack.com/projects/2219752/test-runs/TR-1934/folder/15397164/57242436/1008394969
Email or phone of affected tester (no customers): jsnoidjdosisjdios@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Reports.
  3. Click Default report title.
  4. Enter multiline text with some mark down.

Expected Result:

Default report title field should accept only single line title and will not render mark down because report title supports none of it (can confirm by creating a new report in workspace chat).

Actual Result:

Default report title field accepts multiline title and renders mark down.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7000874_1762886507194.7.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021988468391284008075
  • Upwork Job ID: 1988468391284008075
  • Last Price Increase: 2025-11-12
Issue OwnerCurrent Issue Owner: @jliexpensify

Activity

  1. added
    Daily
    Bug
    on Nov 12, 2025
  2. melvin-bot commented on Nov 12, 2025

    @melvin-bot

    Triggered auto assignment to @jliexpensify (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. nyomanjyotisa commented on Nov 12, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Reports - Default report title field accepts multiline title and renders markdown

    What is the root cause of that problem?

    InputWrapper has type="markdown", autoGrowHeight and maxAutoGrowHeight which enable markdown rendering and multiline input

    <InputWrapper
    InputComponent={TextInput}
    role={CONST.ROLE.PRESENTATION}
    inputID={INPUT_IDS.DEFAULT_TITLE}
    defaultValue={customNameDefaultValue}
    label={translate('workspace.reports.customNameInputLabel')}
    aria-label={translate('workspace.reports.customNameInputLabel')}
    maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
    value={reportTitle}
    spellCheck={false}
    autoFocus
    onChangeText={setReportTitle}
    autoGrowHeight
    type="markdown"
    ref={(el: BaseTextInputRef | null): void => {
    if (!isInputInitializedRef.current) {
    updateMultilineInputRange(el);
    }
    isInputInitializedRef.current = true;
    }}
    />

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

    Remove type="markdown", autoGrowHeight, maxAutoGrowHeight, and the updateMultilineInputRange ref callback to make the input single-line and plain text

    <InputWrapper
        InputComponent={TextInput}
        role={CONST.ROLE.PRESENTATION}
        inputID={INPUT_IDS.DEFAULT_TITLE}
        defaultValue={customNameDefaultValue}
        label={translate('workspace.reports.customNameInputLabel')}
        aria-label={translate('workspace.reports.customNameInputLabel')}
        value={reportTitle}
        spellCheck={false}
        autoFocus
        onChangeText={setReportTitle}
    />

    <InputWrapper
    InputComponent={TextInput}
    role={CONST.ROLE.PRESENTATION}
    inputID={INPUT_IDS.DEFAULT_TITLE}
    defaultValue={customNameDefaultValue}
    label={translate('workspace.reports.customNameInputLabel')}
    aria-label={translate('workspace.reports.customNameInputLabel')}
    maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
    value={reportTitle}
    spellCheck={false}
    autoFocus
    onChangeText={setReportTitle}
    autoGrowHeight
    type="markdown"
    ref={(el: BaseTextInputRef | null): void => {
    if (!isInputInitializedRef.current) {
    updateMultilineInputRange(el);
    }
    isInputInitializedRef.current = true;
    }}
    />

    What alternative solutions did you explore? (Optional)

    None

  4. added
    External
    on Nov 12, 2025
  5. melvin-bot commented on Nov 12, 2025

    @melvin-bot
  6. changed the title [-]Reports - Default report title field accepts multiline title and renders mark down[/-] [+][$250] Reports - Default report title field accepts multiline title and renders mark down[/+] on Nov 12, 2025
  7. added
    Help Wanted
    on Nov 12, 2025
  8. melvin-bot commented on Nov 12, 2025

    @melvin-bot

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

  9. PiyushChandra17 commented on Nov 12, 2025

    @PiyushChandra17
    Contributor

    Proposal

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

    Reports - Default report title field accepts multiline title and renders mark down

    What is the root cause of that problem?

    1. When user taps on "Save", we trigger SetPolicyDefaultReportTitle
    Image
    1. Currently, in FE we do not have logic to prevent markdown and multiline when we call the setPolicyDefaultReportTitle here

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

    1. We should sanitize the input before saving > Before calling setPolicyDefaultReportTitle(policyID, values.defaultTitle), sanitize values.defaultTitle to remove markdown and multiline

    2. We should create a function

    function stripMarkdownAndMultiline(text) {
        // Remove markdown symbols
        let sanitized = text.replace(/[*_~`>#\[\]()!\-+\\]/g, '');
        // Remove newlines
        sanitized = sanitized.replace(/[\r\n]+/g, ' ');
        return sanitized.trim();
    }
    1. Update the save logic
    const sanitizedTitle = stripMarkdownAndMultiline(values.defaultTitle);
    setPolicyDefaultReportTitle(policyID, sanitizedTitle);

    What alternative solutions did you explore? (Optional)

    n/A

    Result

    fix-markdown-multiline.mov
  10. mdneyazahmad commented on Nov 12, 2025

    @mdneyazahmad
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  11. github-actions commented on Nov 12, 2025

    @github-actions
    Contributor

    ⚠️ @mdneyazahmad Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  12. 25 remaining items

  13. jliexpensify commented on Nov 30, 2025

    @jliexpensify
    Contributor

    @allroundexperts sorry, could you clarify what we think should happen here? Does @TaduJR need to open a new PR?

  14. allroundexperts commented on Nov 30, 2025

    @allroundexperts
    Contributor

    @allroundexperts sorry, could you clarify what we think should happen here? Does @TaduJR need to open a new PR?

    All good here.

    This issue came up after @TaduJR merged this PR which was part of #68961.

    I was saying above that this issue should be treated as a follow up rather than a regression of #68961.

  15. jliexpensify commented on Nov 30, 2025

    @jliexpensify
    Contributor

    Thanks for clarifying! Is a checklist needed here?

  16. jliexpensify commented on Nov 30, 2025

    @jliexpensify
    Contributor

    I also wanted to clarify again - no payments required for anyone?

  17. allroundexperts commented on Nov 30, 2025

    @allroundexperts
    Contributor

    If we treat this as a follow up, then payment should be due here for me and @TaduJR.

  18. allroundexperts commented on Nov 30, 2025

    @allroundexperts
    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: This was a follow up to feat: [ORTF] Auto reporting frequency #70615 and the author is aware of this.

    • [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: N/A

    • [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:

    Regression Test Proposal

    Precondition:

    Test:

    1. Open the app.
    2. Go to workspace settings > Reports.
    3. Click Default report title.
    4. Enter multiline text with some mark down.

    Verify that default report title field should accept only single line title and will not render mark down because report title supports none of it (can confirm by creating a new report in workspace chat).

    Do we agree 👍 or 👎

  19. jliexpensify commented on Nov 30, 2025

    @jliexpensify
    Contributor

    Payment Summary

    https://www.upwork.com/jobs/~021988468391284008075

  20. TaduJR commented on Dec 1, 2025

    @TaduJR
    Contributor

    Thanks @jliexpensify

    Offer Accepted!

  21. added
    Daily
    and removed
    Weekly
    on Dec 3, 2025
  22. melvin-bot commented on Dec 4, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@jliexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1988468391284008075/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  23. jliexpensify commented on Dec 4, 2025

    @jliexpensify
    Contributor

    Paid and job closed!

  24. trjExpensify commented on Jan 5, 2026

    @trjExpensify
    Contributor

    approved $250 for @allroundexperts.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions