Skip to content

[HOLD for payment 2024-08-07] [$250] Desktop - Task - Error occurs when update long content for task description for second time #42660

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: 1.4.76-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/runs/view/21450&group_by=cases:section_id&group_order=asc&group_id=291935
Email or phone of affected tester (no customers): crowdtest.expensify+admin@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the app
  2. Start group chat with another user
  3. Create a task for this user without a description
  4. Update description with long content + emoji (Can use in attachment)
  5. Observe the error message of the app show
  6. Update this content to description one more time

Expected Result:

The error of the app shows, warning the user because the content too long

Actual Result:

The error occurs when updating long content for the task description for a second time, after that user can't update the description or task name

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6493142_1716830309579.Screen_Recording_2024-05-27_at_23.57.54.mp4
Bug6493142_1716830309579!Screenshot_2024-05-28_at_00 18 16

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011028270f108dc08b
  • Upwork Job ID: 1795195550390841344
  • Last Price Increase: 2024-06-03
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 102597496
    • samilabud | Contributor | 102597500
Issue OwnerCurrent Issue Owner: @carlosmiceli / @adelekennedy

Activity

  1. added
    Daily
    Bug
    on May 27, 2024
  2. melvin-bot commented on May 27, 2024

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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. lanitochka17 commented on May 27, 2024

    @lanitochka17
    Author

    @bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. lanitochka17 commented on May 27, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. neonbhai commented on May 27, 2024

    @neonbhai
    Contributor

    Proposal

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

    Task - Error occurs when update long content for task description for second time

    What is the root cause of that problem?

    We don't remove the optimistic message if an error occurs, this interfers with get older report action calls since the current report action does not exist in server.

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

    We should update failureData here to set the optimistic message's reportActionID to null

    value: {[editTaskReportAction.reportActionID]: {pendingAction: null}},

    value: {[editTaskReportAction.reportActionID]: null},

    Result

    Before
    Screen.Recording.2024-05-28.at.2.02.36.AM.mov
    After
    Screen.Recording.2024-05-28.at.1.44.43.AM.mov
  6. added
    External
    on May 27, 2024
  7. changed the title [-]Desktop - Task - Error occurs when update long content for task description for second time[/-] [+][$250] Desktop - Task - Error occurs when update long content for task description for second time[/+] on May 27, 2024
  8. melvin-bot commented on May 27, 2024

    @melvin-bot
  9. added
    Help Wanted
    on May 27, 2024
  10. melvin-bot commented on May 27, 2024

    @melvin-bot

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

  11. samilabud commented on May 27, 2024

    @samilabud
    Contributor

    Proposal

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

    Edited Task - Error occurs when description content exceed the 500 characters after parsed as html.

    What is the root cause of that problem?

    This error occurs when description content exceed the 500 characters after parsed as html in getParsedComment(), when we parse the description to HTML format using getParsedComment(). This happens because we validate the limit of 500 characters when it is single text strings, but we send it to the server after parsed, we notice the error when we are near the limit of 500 and the getParsedComment() returns converted the lines breaks to <br />, because this increase the text 5 characters for every line break.

    Technical explanation

    In other words we validate the text has a max length of 500 characters, ie, the next text has 493 characters:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent placerat consectetur enim sit amet sodales. Etiam elementum, lorem id sollicitudin dignissim, quam nibh sodales arcu, imperdiet consequat risus mi sit amet lorem. Donec iaculis at tortor eget vulputate. Duis dignissim non diam id mattis. Suspendisse sit amet consequat elit, feugiat mattis libero. In hendrerit dui ac ante hendrerit condimentum nec

    ddddDonec tellus odio, tristique non hendrerit quis, scelerisque placerat odio.

    But this is converted to (505 characters):

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent placerat consectetur enim sit amet sodales. Etiam elementum, lorem id sollicitudin dignissim, quam nibh sodales arcu, imperdiet consequat risus mi sit amet lorem. Donec iaculis at tortor eget vulputate. Duis dignissim non diam id mattis. Suspendisse sit amet consequat elit, feugiat mattis libero. In hendrerit dui ac ante hendrerit condimentum nec

    ddddDonec tellus odio, tristique non hendrerit quis, scelerisque placerat odio.

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

    We can validate the parsed description max length instead of the plain text here:

    if (values?.description && values.description?.length > CONST.DESCRIPTION_LIMIT) {
    ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: values.description.length, limit: CONST.DESCRIPTION_LIMIT}]);
    }

    Like:

    const validate = useCallback((values: FormOnyxValues<typeof ONYXKEYS.FORMS.EDIT_TASK_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.EDIT_TASK_FORM> => {
            const errors = {};
            const parsedDescription = ReportUtils.getParsedComment(values?.description);
    
            if (parsedDescription && parsedDescription?.length > CONST.DESCRIPTION_LIMIT) {
                ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: parsedDescription.length, limit: CONST.DESCRIPTION_LIMIT}]);
            }
    
            return errors;
        }, []);
    
    Test:
    Max.lenght.parsed.description.mp4

    What alternative solutions did you explore?

    We can remove the ReportUtils.getParsedComment(description) and let the description as a plain text.

  12. 57 remaining items

  13. abdulrahuman5196 commented on Aug 8, 2024

    @abdulrahuman5196
    Contributor

    The PR that introduced the bug has been identified. Link to the PR:
    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:
    A discussion in #expensify-bugs 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:

    Not a regression IMO

    Determine if we should create a regression test for this bug.

    Yes.

    If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    1. Start group chat with another user
    2. Create a task for this user without a description
    3. Update description with long content + emoji
    4. Observe the error message of the app show
    5. Update this content to description one more time

    @adelekennedy I haven't received payment for this. And I am getting paid in newDot. Thank you.

  14. adelekennedy commented on Aug 8, 2024

    @adelekennedy
    Contributor

    @abdulrahuman5196 that's my bad - I see that you ended the contract vs us closing and paying out

    Contributor: @abdulrahuman5196 paid $250 via Upwork ( Matt A did on 8/30 as a bonus payment)

  15. adelekennedy commented on Aug 8, 2024

    @adelekennedy
    Contributor
  16. abdulrahuman5196 commented on Aug 29, 2024

    @abdulrahuman5196
    Contributor

    Payment is still pending on this issue.

  17. adelekennedy commented on Aug 30, 2024

    @adelekennedy
  18. abdulrahuman5196 commented on Aug 30, 2024

    @abdulrahuman5196
    Contributor

    @adelekennedy I closed the contract before because I am getting paid via newDot now 😅 as called out.
    And to answer question, only after my previous comment, it was remitted.
    If possible kindly request a refund, so that I can get paid via newDot.

  19. adelekennedy commented on Aug 30, 2024

    @adelekennedy
    Contributor

    🤦‍♀️

    Payouts due:

  20. mallenexpensify commented on Aug 30, 2024

    @mallenexpensify
    Contributor

    @abdulrahuman5196 , can you please cancel your NewDot payment request! I've paid you via Upwork. You were assigned to this issue before your eligibility date. Thx

  21. abdulrahuman5196 commented on Aug 31, 2024

    @abdulrahuman5196
    Contributor

    Deleted the newDot expense. Thank you for payment.

  22. abdulrahuman5196 commented on Sep 2, 2024

    @abdulrahuman5196
    Contributor

    hi not overdue, We can close this issue @adelekennedy

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