Skip to content

[HOLD for payment 2024-07-10] [$250] Task – Unable to create a task with a long description, error appears #43565

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.82-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?/tests/view/4621858
Email or phone of affected tester (no customers): applausetester+jp_e_category_1@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com
  2. Log in
  3. Open any chat
  4. Click on + and select Assign task
  5. Enter task title
  6. Enter long description less than 500 character. My description: Chat is scrolled up when go back from the thread twice via header link 1. Go to https://staging.new.expensify.com/
  7. Log in. 3. Open any chat with a long history and send a message 4. Create a thread and send a message in thread 5. Navigate to the chat via header link 6. Click on reply link to open thread again 7. Navigate to the chat via header link again Last message with a thread is visible Chat is scrolled up and last message with a thread is not visible Platform: Web/mWeb
  8. Assign task to any user and confirm task

Expected Result:

Unable to create a task with a long description

Actual Result:

Unexpected error create task appears: Unexpected error create task, please try again later.

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

Bug6510235_1718166255763.Long_description.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011ddeeb8acc28f12c
  • Upwork Job ID: 1801650121422631424
  • Last Price Increase: 2024-06-14
  • Automatic offers:
    • truph01 | Contributor | 102799645
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 12, 2024
  2. melvin-bot commented on Jun 12, 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. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 14, 2024
  4. changed the title [-]Task – Unable to create a task with a long description, error appears[/-] [+][$250] Task – Unable to create a task with a long description, error appears[/+] on Jun 14, 2024
  5. melvin-bot commented on Jun 14, 2024

    @melvin-bot
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 14, 2024
  7. melvin-bot commented on Jun 14, 2024

    @melvin-bot

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

  8. truph01 commented on Jun 14, 2024

    @truph01
    Contributor

    Proposal

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

    Unexpected error create task appears: Unexpected error create task, please try again later.

    What is the root cause of that problem?

    In

    if (values.taskDescription.length > CONST.DESCRIPTION_LIMIT) {
    , it's only checking values.taskDescription.length to validate the length. But the task description is a markdown-enabled input, so later it will be converted to HTML when sending to back-end.

    After converted to HTML, the length of the text will be higher (more than 500), so back-end throws.

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

    Validate the task description using same way as other markdown-enabled inputs:

    if (ReportUtils.getCommentLength(value, parsingDetails) <= CONST.MAX_COMMENT_LENGTH) {

    const descriptionLength = ReportUtils.getCommentLength(values.reportDescription);

    By using ReportUtils.getCommentLength to get the correct after-parsing length of the text, also consistent with back-end

    In https://github.com/Expensify/App/blob/main/src/pages/tasks/NewTaskDetailsPage.tsx#L64-L66:

    const taskDescriptionLength = ReportUtils.getCommentLength(values.taskDescription);
            if (taskDescriptionLength > CONST.DESCRIPTION_LIMIT) {
                ErrorUtils.addErrorMessage(errors, 'taskDescription', ['common.error.characterLimitExceedCounter', {length: taskDescriptionLength, limit: CONST.DESCRIPTION_LIMIT}]);
            }
    

    Same fix can apply to the task description edit page/other markdown-enabled inputs.

    What alternative solutions did you explore? (Optional)

  9. studentofcoding commented on Jun 17, 2024

    @studentofcoding
    Contributor

    if (values.taskDescription.length > CONST.DESCRIPTION_LIMIT) {

    Proposal

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

    Unexpected error create task appears: Unexpected error create task, please try again later.

    What is the root cause of that problem?

    In

    if (values.taskDescription.length > CONST.DESCRIPTION_LIMIT) {

    , it's only checking values.taskDescription.length to validate the length. But the task description is a markdown-enabled input, so later it will be converted to HTML when sending to back-end.
    After converted to HTML, the length of the text will be higher (more than 500), so back-end throws.

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

    Validate the task description using same way as other markdown-enabled inputs:

    if (ReportUtils.getCommentLength(value, parsingDetails) <= CONST.MAX_COMMENT_LENGTH) {

    const descriptionLength = ReportUtils.getCommentLength(values.reportDescription);

    By using ReportUtils.getCommentLength to get the correct after-parsing length of the text, also consistent with back-end

    In https://github.com/Expensify/App/blob/main/src/pages/tasks/NewTaskDetailsPage.tsx#L64-L66:

    const taskDescriptionLength = ReportUtils.getCommentLength(values.taskDescription);
            if (taskDescriptionLength > CONST.DESCRIPTION_LIMIT) {
                ErrorUtils.addErrorMessage(errors, 'taskDescription', ['common.error.characterLimitExceedCounter', {length: taskDescriptionLength, limit: CONST.DESCRIPTION_LIMIT}]);
            }
    

    Same fix can apply to the task description edit page/other markdown-enabled inputs.

    What alternative solutions did you explore? (Optional)

    The solutions are on point

  10. 14 remaining items

  11. changed the title [-][$250] Task – Unable to create a task with a long description, error appears[/-] [+][HOLD for payment 2024-07-10] [$250] Task – Unable to create a task with a long description, error appears[/+] on Jul 3, 2024
  12. melvin-bot commented on Jul 3, 2024

    @melvin-bot

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

  13. melvin-bot commented on Jul 3, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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 2024-07-10. 🎊

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

  14. melvin-bot commented on Jul 3, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
    • [@mananjadhav] 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:
    • [@mananjadhav] 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:
    • [@mananjadhav] Determine if we should create a regression test for this bug.
    • [@mananjadhav] 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.
    • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  15. mananjadhav commented on Jul 10, 2024

    @mananjadhav
    Collaborator

    I think we should've added this when we had Markdown support. I couldn't pint the exact PR when we added to the field. But now that we've added I don't think we need a regression test for this one.

    @bfitzexpensify This is ready for payout.

  16. bfitzexpensify commented on Jul 10, 2024

    @bfitzexpensify
    Contributor

    Payment summary:

    @mananjadhav to be paid $250 for C+ via manual request
    @truph01 to be paid $250 for contributor work - paid ✅

  17. JmillsExpensify commented on Jul 11, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @mananjadhav

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 contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions