App icon indicating copy to clipboard operation
App copied to clipboard

[$500] Room - Room with long description can not be created

Open lanitochka17 opened this issue 1 year ago β€’ 10 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.38-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/4286969&group_by=cases:section_id&group_order=asc&group_id=229067 Email or phone of affected tester (no customers): [email protected] Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Log in to NewDot with a High traffic account that owns a existing Workspace
  2. Click on the green + button
  3. Click on the "Start Chat" option
  4. Click the tab '#Room'
  5. Add a room name
  6. Add very long description
  7. Finish the flow

Expected Result:

Room should be created

Actual Result:

Created Room disappears immediately / Room with long description can not be created

Workaround:

Unknown

Platforms:

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

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/cfd9bee0-bb19-45f2-94c4-7e9ec3e60256

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018e6835f3eb8880f2
  • Upwork Job ID: 1755332022294048768
  • Last Price Increase: 2024-02-07

lanitochka17 avatar Feb 07 '24 20:02 lanitochka17

Job added to Upwork: https://www.upwork.com/jobs/~018e6835f3eb8880f2

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

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

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

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

lanitochka17 avatar Feb 07 '24 20:02 lanitochka17

Not a bug this was intentional https://github.com/Expensify/App/pull/34150#issuecomment-1915928141

cc @puneetlath

ishpaul777 avatar Feb 07 '24 20:02 ishpaul777

Shouldn't we give an error message if the length crosses a particular value then? this is sort of crash behavior we don't want the user to face right? @ishpaul777 @puneetlath :thinking:

allgandalf avatar Feb 07 '24 20:02 allgandalf

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

A new room fails to save if it has a long description, it will appear for a second in the UI then disappear

What is the root cause of that problem?

The endpoint returns an error and does not save the room. The room is added to the UI optimistically and when the endpoint errors it is removed < 1s later

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

Another else if statement in the validate() function of WorkspaceNewRoomPage.js like this

else if (values.reportDescription.length > CONST.REPORT_DESCRIPTION.MAX_LENGTH) {
      ErrorUtils.addErrorMessage(errors, 'reportDescription', 'Error message here');
  }

Will stop the form from being able to be submitted when the descrition is too long. What alternative solutions did you explore? (Optional) None

jcdiprose avatar Feb 07 '24 21:02 jcdiprose

Proposal

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

When a room is created with a very long description, it fails without any error message.

What is the root cause of that problem?

https://github.com/Expensify/App/blob/e2b670428a07919c8a37d3f3c8cf1963ffd0297a/src/pages/workspace/WorkspaceNewRoomPage.js#L315-L315 https://github.com/Expensify/App/blob/8da7fe5a52a262ea3a18e087ff07f00dd84255de/src/CONST.ts#L105-L107

The maximum length of a room description is set to 1024 but the backend enforces a difference, lower value. This causes the front end to accept the descripiton but it's then rejected by the backend.

Screenshot 2024-02-07 at 6 20 51β€―PM

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

Align the maximum length of a room description in the front end with the backend by changing the constant shown above.

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.

barros001 avatar Feb 07 '24 21:02 barros001

The maximum length of a room description is set to 1024 but the backend enforces a difference, lower value. This causes the front end to accept the descripiton but it's then rejected by the backend.

okay sorry I didn't understand the issue properly earlier, i think the issue is with Backend πŸ‘

Screenshot 2024-02-08 at 3 07 41β€―AM

ishpaul777 avatar Feb 07 '24 21:02 ishpaul777

agree with @ishpaul777 :), but if we want to keep the backend as it is then @barros001's proposal would make sense here

allgandalf avatar Feb 07 '24 21:02 allgandalf

Hey @puneetlath , when you have a moment can you check this one, it seems to be a Backend issue related to Room description length. Thanks!

ishpaul777 avatar Feb 12 '24 15:02 ishpaul777

Our back-end MAX_DESCRIPTION_LENGTH is set to 500 characters (https://github.com/Expensify/Web-Expensify/blob/main/lib/Report.php#L704). I'll ask in Slack whether we want to shorten the front-end maximum or increase the back-end max: https://expensify.slack.com/archives/C066HJM2CAZ/p1707859355835099

sakluger avatar Feb 13 '24 21:02 sakluger

Triggered auto assignment to Contributor Plus for review of internal employee PR - @mollfpr (Internal)

melvin-bot[bot] avatar Feb 13 '24 21:02 melvin-bot[bot]

We'd like to go with the longer 1024 limit, which means this is a BE change. I've applied the internal label and will make the change myself since we're just changing the value of a const.

sakluger avatar Feb 13 '24 21:02 sakluger

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

melvin-bot[bot] avatar Feb 13 '24 22:02 melvin-bot[bot]

Sorry for the back and forth, but I was wrong. We previously decided that 500 is the standard length for fields like this, as documented in Stack Overflow: https://stackoverflowteams.com/c/expensify/questions/17034.

That means that we should update the front-end value to 500 to match the back-end value. I'll update the original description appropriately.

sakluger avatar Feb 13 '24 22:02 sakluger

By the way, @ishpaul777 - do you know if you're properly set up as a C+ in Github? The issue keeps trying to assign other C+ people even though you're already assigned. I can check internally to see what the issue is, but thought you might know.

sakluger avatar Feb 13 '24 22:02 sakluger

Upwork job price has been updated to $250

melvin-bot[bot] avatar Feb 13 '24 22:02 melvin-bot[bot]

Proposal

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

Room with long description can not be created

What is the root cause of that problem?

Currently the length is set to 1024 https://github.com/Expensify/App/blob/8da7fe5a52a262ea3a18e087ff07f00dd84255de/src/CONST.ts#L105-L107

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

Change it to 500 as the backend expects the same

What alternative solutions did you explore? (Optional)

N/A

allgandalf avatar Feb 13 '24 22:02 allgandalf

Also, I'm changing the price to $250 since this is a simple change.

sakluger avatar Feb 13 '24 22:02 sakluger

I am temporarily removed from c+ GH team as i am starting to work on track expense project soon https://expensify.slack.com/archives/C02NK2DQWUX/p1707854919280159

But since this is simple change and i was assigned before i think i have the bandwidth to handle this

ishpaul777 avatar Feb 13 '24 22:02 ishpaul777

Proposal

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

Room - Room with long description can not be created

What is the root cause of that problem?

The value is 1024. https://github.com/Expensify/App/blob/d50d603d7a9065a747d7ea957b69c886f86d29f7/src/CONST.ts#L105-L107

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

We need to update the value of REPORT_DESCRIPTION from 1024 to 500 as stated in BE the value is 500, so we need to update frontend as well.

What alternative solutions did you explore? (Optional)

N/A

godofoutcasts94 avatar Feb 13 '24 22:02 godofoutcasts94

Thanks for your proposals @godofoutcasts94 @GandalfGwaihir but your proposals are similar to @barros001's proposal. (i know the exact value was not added but it was not known until now)

@barros001's proposal LGTM!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

ishpaul777 avatar Feb 13 '24 22:02 ishpaul777

πŸŽ€ πŸ‘€ πŸŽ€

situchan avatar Feb 13 '24 22:02 situchan

Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Feb 13 '24 22:02 melvin-bot[bot]

Thanks @situchan

ishpaul777 avatar Feb 13 '24 22:02 ishpaul777

πŸ“£ @barros001 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Feb 14 '24 14:02 melvin-bot[bot]

PR is up for review. Just missing Android and iOS native videos as I'll have to rebuild them and it takes a little while.

Edit: all videos uploaded.

barros001 avatar Feb 14 '24 16:02 barros001

this should be ready for payment @sakluger (bumping as the automation failed to add awaiting payment label)

ishpaul777 avatar Mar 07 '24 12:03 ishpaul777

Summarizing payment on this issue:

Contributor: @barros001 $250, paid via Upwork Contributor+: @ishpaul777 $250, sent offer via Upwork, please let me know once you've accepted the offer

sakluger avatar Mar 12 '24 19:03 sakluger