Skip to content

[$250] When we set description of a room for the first time, optimistically it is shown as a comment in the LHN and later updates to system message #46046

Closed

Description

@m-natarajan

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.0.11-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @allgandalf
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1721729123500449

Action Performed:

  1. Create a room
  2. Click on room heading
  3. Go to description and set description
  4. Observe in LHN that the exact description entered is shown first then it updates to system message

Expected Result:

Description entered is displayed

Actual Result:

Description entered is shown first then it updates to system message

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

Screen.Recording.2024-07-23.at.3.35.05.PM.mov

Add any screenshot/video evidence

View all open jobs on GitHub

Recording.381.mp4
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d1a09eb334a44e74
  • Upwork Job ID: 1816626243288402483
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • allgandalf | Contributor | 103318023
    • FitseTLT | Contributor | 103373101
Issue OwnerCurrent Issue Owner: @

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 23, 2024
  2. melvin-bot commented on Jul 23, 2024

    @melvin-bot

    Triggered auto assignment to @VictoriaExpensify (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. FitseTLT commented on Jul 23, 2024

    @FitseTLT
    Contributor

    Proposal

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

    When we set description of a room for the first time, optimistically it is shown as a comment in the LHN and later updates to system message

    What is the root cause of that problem?

    Because we do not create an optimistic action (room description updated type of action) in updateDescription the LHN will default to show the description as there will no be any report action until the room update report action is returned from the server.

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

    We need to create an optimistic room description updated report action in updateDescription.
    We should do similar thing as we did for creating room name updated optimistic report action in here

    App/src/libs/actions/Report.ts

    Lines 2239 to 2262 in a3df238

    const optimisticRenamedAction = ReportUtils.buildOptimisticRenamedRoomReportAction(policyRoomName, previousName ?? '');
    const optimisticData: OnyxUpdate[] = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: {
    reportName: policyRoomName,
    pendingFields: {
    reportName: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    },
    errorFields: {
    reportName: null,
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [optimisticRenamedAction.reportActionID]: optimisticRenamedAction,
    },
    },
    ];

    We create a similar util function as buildOptimisticRenamedRoomReportAction which takes new description as a param and creates a UPDATEROOMDESCRIPTION report action with the same content as would be returned from the server. And we then update the optimistic, success and failure data accordingly to include the optimistically created report action.


    Work expected from the BE : the UPDATE_ROOM_DESCRIPTION api should start accepting reportActionID so that it will use the optimistically created reportActionID. Then we will pass the report Action ID as a parameter.

    What alternative solutions did you explore? (Optional)

  4. allgandalf commented on Jul 23, 2024

    @allgandalf
    Contributor

    Note

    I can take this as a C+ as i reported this issue and have more context

  5. VictoriaExpensify commented on Jul 26, 2024

    @VictoriaExpensify
    Contributor

    Recreated the issue. Agree this is buggy and we should fix it

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 26, 2024
  7. melvin-bot commented on Jul 26, 2024

    @melvin-bot
  8. changed the title [-]When we set description of a room for the first time, optimistically it is shown as a comment in the LHN and later updates to system message[/-] [+][$250] When we set description of a room for the first time, optimistically it is shown as a comment in the LHN and later updates to system message[/+] on Jul 26, 2024
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 26, 2024
  10. melvin-bot commented on Jul 26, 2024

    @melvin-bot

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

  11. 40 remaining items

  12. allgandalf commented on Aug 12, 2024

    @allgandalf
    Contributor

    PR was raised, today, I will review it soon

  13. allgandalf commented on Aug 14, 2024

    @allgandalf
    Contributor

    Approved the PR, all yours @marcochavezf 🙇

  14. allgandalf commented on Aug 16, 2024

    @allgandalf
    Contributor

    PR is on staging ♻️

  15. allgandalf commented on Aug 27, 2024

    @allgandalf
    Contributor

    Regression Test Proposal

    1. Create a room
    2. Click on room heading and go offline
    3. Go to description and set description

    Verify that 'the room description updated' system message is shown

    Verify also that the same system message is shown in LHN

    Do we agree 👍 or 👎

  16. allgandalf commented on Aug 27, 2024

    @allgandalf
    Contributor

    @VictoriaExpensify can you pay this one please 🙇

  17. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 27, 2024
  18. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 27, 2024
  19. melvin-bot commented on Aug 27, 2024

    @melvin-bot

    Current assignee @allgandalf is eligible for the External assigner, not assigning anyone new.

  20. VictoriaExpensify commented on Aug 27, 2024

    @VictoriaExpensify
    Contributor
  21. VictoriaExpensify commented on Aug 27, 2024

    @VictoriaExpensify
    Contributor

    Payment Summary:
    Contributor: @FitseTLT paid $250 via Upwork
    Contributor+: @allgandalf paid $250 via Upwork

    Thanks for your work on this!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsReviewingHas a PR in review

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions