Skip to content

[HOLD for payment 2024-07-10] Thread - Thread title not updated in header and in LHN after editing parent message #44430

Closed

Description

@izarutskaya

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.2-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4675207
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Open any chat
  3. Send a message and create a thread
  4. Change the parent message to anything

Expected Result:

The thread title is updated in the header and in LHN

Actual Result:

The thread title still displays the parent message before editing. It updates in the header after opening the thread again, but does not change in the LHN

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

Bug6524884_1719386508521.Recording__578.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jun 26, 2024
  2. melvin-bot commented on Jun 26, 2024

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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. melvin-bot commented on Jun 26, 2024

    @melvin-bot

    Triggered auto assignment to @iwiznia (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. github-actions commented on Jun 26, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. izarutskaya commented on Jun 26, 2024

    @izarutskaya
    Author

    @trjExpensify 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.

  6. izarutskaya commented on Jun 26, 2024

    @izarutskaya
    Author

    We think this issue might be related to the #vip-vsb

  7. bernhardoj commented on Jun 26, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Thread title and LHN title doesn't update immediately when updating the thread parent message.

    What is the root cause of that problem?

    For the thread title, we get the title from getReportActionMessage which uses parseReportActionHtmlToText. parseReportActionHtmlToText has a cache mechanism with the cache key being the combination of the reportID, reportActionID, and the report action lastModified.

    App/src/libs/ReportUtils.ts

    Lines 3238 to 3242 in 0c20881

    const key = `${reportID}_${reportAction.reportActionID}_${reportAction.lastModified}`;
    const cachedText = parsedReportActionMessageCache[key];
    if (cachedText !== undefined) {
    return cachedText;
    }

    There are 2 problems here. First, we don't optimistically update the lastModified when editing a message, so we rely on the BE response to update it. Second, we get the report action by using the deprecated getParentReportAction and since we enable the react-compiler in #42287, it means the component won't react to the parent report action updates because ReportUtils.getReportName only use the report data.

    App/src/libs/ReportUtils.ts

    Lines 3322 to 3324 in 0c20881

    function getReportName(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>): string {
    let formattedName: string | undefined;
    const parentReportAction = ReportActionsUtils.getParentReportAction(report);

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

    First, update the lastModified optimistically (and revert if fails).

    App/src/libs/actions/Report.ts

    Lines 1530 to 1543 in 0c20881

    const optimisticReportActions: PartialDeep<ReportActions> = {
    [reportActionID]: {
    pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    message: [
    {
    ...originalMessage,
    type: CONST.REPORT.MESSAGE.TYPE.COMMENT,
    isEdited: true,
    html: htmlForNewComment,
    text: reportComment,
    },
    ],
    },
    };

    This change alone is enough because the report data is also updated which triggers the getReportName, but we should start passing the parent report action as the 3rd param.

    const title = ReportUtils.getReportName(reportHeaderData);

    const title = ReportUtils.getReportName(reportHeaderData, undefined, parentReportAction);

  8. 12 remaining items

  9. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jul 3, 2024
  10. changed the title [-]Thread - Thread title not updated in header and in LHN after editing parent message[/-] [+][HOLD for payment 2024-07-10] Thread - Thread title not updated in header and in LHN after editing parent message[/+] on Jul 3, 2024
  11. melvin-bot commented on Jul 3, 2024

    @melvin-bot

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

  12. 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:

  13. 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:

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

    @rushatgabhane
    Member
    1. The PR that introduced the bug has been identified. Link to the PR: the bug stems from react compiler pr - [NoQA] feat: react-compiler #42287

    2. 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: [NoQA] feat: react-compiler #42287 (review)

    3. 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.

    4. Determine if we should create a regression test for this bug. No because caught by QA and rca was react compiler which is one time thing.

    5. 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 - N.A.

  15. trjExpensify commented on Jul 10, 2024

    @trjExpensify
    Contributor

    Payment summary as follows:

    Feel free to go ahead and request, both of you. Closing!

  16. bernhardoj commented on Jul 11, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  17. JmillsExpensify commented on Jul 11, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  18. JmillsExpensify commented on Jul 17, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @rushatgabhane

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.EngineeringWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions