Skip to content

[Due for payment 2025-03-27] Report fields - App crashes when field type “Text” is selected #58135

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: v9.1.11-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5715253
Email or phone of affected tester (no customers): sustinov@applausemail.com
Issue reported by: Applause Internal Team
Device used: Macbook/15.3/Chrome, OnePlus 9 PRO/Android 14/Chrome, iPhone 12 PRO/iOS 18.3.1
App Component: Workspace Settings

Action Performed:

  1. Open new expensify app
  2. Log in with a new HT account
  3. Create a new WS
  4. Navigate to the WS settings
  5. Navigate to More features
  6. Enable Report fields
  7. Navigate to Report fields
  8. Click on the “Add field” button
  9. Select in RHP Type -> Text

Expected Result:

The application should not crash when the “Text” field type is selected

Actual Result:

App crashes when field type “Text” is selected

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6766835_1741658097844!WEB_staging.new.expensify.com-1741658047195.txt

Bug6766835_1741653444990.Recording__277.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @NicMendonca

Activity

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

    @melvin-bot

    Triggered auto assignment to @NicMendonca (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. daledah commented on Mar 11, 2025

    @daledah
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-03-11 02:12:23 UTC.

    Proposal

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

    App crashes when field type “Text” is selected

    What is the root cause of that problem?

    When user first select type Text, formInitialValue is undefined, because initialValue input is not shown yet:

    {inputValues[INPUT_IDS.TYPE] === CONST.REPORT_FIELD_TYPES.TEXT && (
    <InputWrapper
    InputComponent={TextPicker}
    inputID={INPUT_IDS.INITIAL_VALUE}
    label={translate('common.initialValue')}
    subtitle={translate('workspace.reportFields.initialValueInputSubtitle')}
    description={translate('common.initialValue')}
    accessibilityLabel={translate('workspace.editor.initialValueInputLabel')}
    maxLength={CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH}
    multiline={false}
    role={CONST.ROLE.PRESENTATION}
    />
    )}

    So the condition here will crash app because undefined doesn't have length

    if (type === CONST.REPORT_FIELD_TYPES.TEXT && formInitialValue.length > CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH) {

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

    Add condition to check if formInitialValue is truthy

    if (type === CONST.REPORT_FIELD_TYPES.TEXT && formInitialValue.length > CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH) {

    if (type === CONST.REPORT_FIELD_TYPES.TEXT && !!formInitialValue && formInitialValue.length > CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH) {

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

    We can simulate user click and verify the screen is rendered properly with type field is displayed correctly

    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.

  4. github-actions commented on Mar 11, 2025

    @github-actions
    Contributor

    ⚠️ Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  5. layacat commented on Mar 11, 2025

    @layacat
    Contributor

    regression from #56588

  6. NicMendonca commented on Mar 11, 2025

    @NicMendonca
    Contributor

    @paultsimura @slafortune @mountiny can you confirm? ^^ This would be the issue where the regression came from? #56003

  7. paultsimura commented on Mar 11, 2025

    @paultsimura
    Contributor

    @paultsimura @slafortune @mountiny can you confirm? ^^ This would be the issue where the regression came from? #56003

    Looks like it is.
    @shubham1206agra please take a look

  8. shubham1206agra commented on Mar 11, 2025

    @shubham1206agra
    Contributor

    @paultsimura @mountiny I can run the basic fix for this right now. However, this should be investigated more deeply since we always initialize the value as an empty string for input.

  9. daledah commented on Mar 13, 2025

    @daledah
    Contributor

    @shubham1206agra In this case the input doesn't even existed yet in the component tree so there's no initial value.

  10. mountiny commented on Mar 13, 2025

    @mountiny
    Contributor

    @shubham1206agra can you please prioritize this fix?

  11. 6 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 20, 2025
  13. changed the title [-]Report fields - App crashes when field type “Text” is selected[/-] [+][Due for payment 2025-03-27] Report fields - App crashes when field type “Text” is selected[/+] on Mar 20, 2025
  14. melvin-bot commented on Mar 20, 2025

    @melvin-bot

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

  15. melvin-bot commented on Mar 20, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.15-9 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 2025-03-27. 🎊

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

  16. melvin-bot commented on Mar 20, 2025

    @melvin-bot

    @shubham1206agra @NicMendonca @shubham1206agra 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]

  17. slafortune commented on Mar 21, 2025

    @slafortune
    Contributor

    @NicMendonca I can take care of the payment here - #56003

  18. shubham1206agra commented on Mar 22, 2025

    @shubham1206agra
    Contributor

    @slafortune No payment required here.

  19. mountiny commented on Mar 24, 2025

    @mountiny
    Contributor

    @paultsimura @shubham1206agra coul dyou just please complete the checklist and we can close this. Thanks!

  20. paultsimura commented on Mar 24, 2025

    @paultsimura
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: https://github.com/Expensify/App/pull/56588/files#r2010062723

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

  21. NicMendonca commented on Mar 26, 2025

    @NicMendonca
    Contributor

    @paultsimura do we need a regression test?

  22. mountiny commented on Mar 26, 2025

    @mountiny
    Contributor

    I dont think we need a specific regression test for this one

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions