Skip to content

[HOLD for payment 2024-10-25] [$250] Room-Description with mentions shown in preview but after saved disappeared #49407

Closed

Description

@IuliiaHerets

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.37-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open a room chat
  3. Tap header -- description
  4. Enter description with mention and save it eg : Hamburger squishes content on mobile web (native?) #233

Expected Result:

Description with mentions shown in preview and must be displayed after saved also.

Actual Result:

Description with mentions shown in preview but after saved shown briefly and disappears.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6607424_1726644443287.screenrecorder-2024-09-18-10-28-17-734_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836660554703667076
  • Upwork Job ID: 1836660554703667076
  • Last Price Increase: 2024-10-03
  • Automatic offers:
    • rayane-djouah | Reviewer | 104326440
    • truph01 | Contributor | 104326443
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    Daily
    Bug
    on Sep 18, 2024
  2. melvin-bot commented on Sep 18, 2024

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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. IuliiaHerets commented on Sep 18, 2024

    @IuliiaHerets
    Author

    @greg-schroeder 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. truph01 commented on Sep 19, 2024

    @truph01
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-09-19 17:04:09 UTC.

    Proposal

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

    • Description with mentions shown in preview but after saved shown briefly and disappears.

    What is the root cause of that problem?

    • When we save description "#123xxx", we sent to BE "<mention-report>#123xxx</mention-report>" but BE returns "#123xxx" - a MD string.

    • And shouldParseTitle is not added in this:

    <MenuItemWithTopDescription

    while the description returned by BE is a MD string.

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

    • When display "#123xxx" we should check if "123xxx" is reportName data of any report in the current policy. If yes, highlight that text.

    • First, update:

      <MenuItemWithTopDescription

                               <MentionReportContext.Provider value={mentionReportContextValue}>
                                    <MenuItemWithTopDescription ... />
                               </MentionReportContext.Provider> 
    
      const mentionReportContextValue = useMemo(() => ({currentReportID: report.reportID, exact: true}), [report.reportID]);
    
    • Second, update:

                                excludedMarkdownStyles={isReportInGroupPolicy ? ['mentionReport'] : []}
    

    with:

        const isReportInGroupPolicy = !!report?.policyID && report.policyID !== CONST.POLICY.ID_FAKE;
    

    to make sure the reportMentions markdown is only applied if the current report belongs to policy.

    • Finally, update this:


    to:

                            isGroupPolicyReport && (!exact || navigationRoute)
    

    What alternative solutions did you explore? (Optional)

    See

    Fix the description preview

    • We should update that MenuItemWithTopDescription to:
    +                          <MentionReportContext.Provider value={mentionReportContextValue}>
                                    <MenuItemWithTopDescription
    +                                  shouldParseTitle
    -                                  shoudlRenderAsHTML
    +                                 excludedMarkdownRules={!policy ? ['reportMentions'] : []}
                                    />
    +                          </MentionReportContext.Provider>
    +  const mentionReportContextValue = useMemo(() => ({currentReportID: report.reportID}), [report.reportID]);

    Fix the description's form

    • Next, we need to fix the RoomDescriptionPage so that it will send the markdown data to BE instead of HTML.

    • First, update:

    const [description, setDescription] = useState(() => Parser.htmlToMarkdown(report?.description ?? ''));

        const [description, setDescription] = useState(report?.description ?? '');
    
    • Last, update:
      const optimisticDescriptionUpdatedReportAction = ReportUtils.buildOptimisticRoomDescriptionUpdatedReportAction(parsedDescription);
        const parsedDescription = Parser.htmlToMarkdown(ReportUtils.getParsedComment(newValue, {reportID}));
    
  5. added
    External
    on Sep 19, 2024
  6. changed the title [-]Room-Description with mentions shown in preview but after saved disappeared[/-] [+][$250] Room-Description with mentions shown in preview but after saved disappeared[/+] on Sep 19, 2024
  7. melvin-bot commented on Sep 19, 2024

    @melvin-bot
  8. added
    Help Wanted
    on Sep 19, 2024
  9. melvin-bot commented on Sep 19, 2024

    @melvin-bot

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

  10. FitseTLT commented on Sep 19, 2024

    @FitseTLT
    Contributor

    This is not a bug. If we mention a correct room the BE sets the description to the mention of that room and it is a correct clickable mention but if the BE doesn't get a room with that name it will consider it a normal text so the mention will disappear. In compose we have a option to deal with this case with a whisper message explaining that the room doesn't exist and ask if the user wants to create it but in this case I think it is unnecessary.

  11. truph01 commented on Sep 19, 2024

    @truph01
    Contributor

    @greg-schroeder Can you confirm the expected behavior here? In the preview, should we always highlight the text #any-text, or we just highlight it if #any-text is the reportName of the existing report?

  12. 32 remaining items

  13. truph01 commented on Oct 9, 2024

    @truph01
    Contributor

    PR is ready

  14. greg-schroeder commented on Oct 14, 2024

    @greg-schroeder
    Contributor

    @rayane-djouah is up for review!

  15. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Oct 18, 2024
  16. changed the title [-][$250] Room-Description with mentions shown in preview but after saved disappeared[/-] [+][HOLD for payment 2024-10-25] [$250] Room-Description with mentions shown in preview but after saved disappeared[/+] on Oct 18, 2024
  17. removed
    Reviewing
    on Oct 18, 2024
  18. melvin-bot commented on Oct 18, 2024

    @melvin-bot

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

  19. melvin-bot commented on Oct 18, 2024

    @melvin-bot

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

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

  20. melvin-bot commented on Oct 18, 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:

    • [@rayane-djouah] The PR that introduced the bug has been identified. Link to the PR:
    • [@rayane-djouah] 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:
    • [@rayane-djouah] 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:
    • [@rayane-djouah] Determine if we should create a regression test for this bug.
    • [@rayane-djouah] 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.
    • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  21. rayane-d commented on Oct 19, 2024

    @rayane-d
    Contributor

    BugZero Checklist

    • The PR that introduced the bug has been identified. Link to the PR: Missed case in feature implementation Adds support for mentions in room description #45352
    • 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: Adds support for mentions in room description #45352 (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: N/A
    • 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.

    Regression Test Proposal

    1. Open a room chat.
    2. Tap the header > description.
    3. Enter a description with a room mention (ensure that the mentioned room does not exist).
    4. Click on "Save."
    5. Verify that the room mention is not highlighted in the description preview.
    6. Open a room chat again.
    7. Tap the header > description.
    8. Enter a description with a room mention (ensure that the mentioned room exists).
    9. Verify that the room mention is highlighted in the description preview.
    

    Do we agree 👍 or 👎

  22. greg-schroeder commented on Oct 25, 2024

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @truph01 - $250 via Upwork
    C+: @rayane-djouah - $250 via Upwork

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

Metadata

Metadata

Labels

Awaiting PaymentBugExternalWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions