Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: Web - The message "This is the beginning of your chat" is displayed for a while when opening the requested money detail #23647

Closed
1 of 6 tasks
kbecciv opened this issue Jul 26, 2023 · 15 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed

Comments

@kbecciv
Copy link

kbecciv commented Jul 26, 2023

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


Action Performed:

  1. Open a chat.
  2. Navigate to "Request money"
  3. Enter the amount and request it
  4. Now open requested money detail

Expected Result:

The message "This is the beginning of your chat" should not be displayed when opening the requested money detail

Actual Result:

The message "This is the beginning of your chat" is displayed for a while when opening the requested money detail

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: Dev 1.3.45-
Reproducible in staging?: no
Reproducible in production?: no
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
Notes/Photos/Videos: Any additional supporting documentation

screen-recording-2023-07-26-at-122722-am_EOV5yypL.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690313678511779

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@kbecciv kbecciv changed the title Dev: Web - Composer is hidden for a moment when clicking 'Reply in thread' icon Dev: Web - The message "This is the beginning of your chat" is displayed for a while when opening the requested money detail Jul 26, 2023
@s-alves10
Copy link
Contributor

Proposal

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

The message "This is the beginning of your chat" is displayed for a while when opening the requested money detail

What is the root cause of that problem?

When we open the requested money detail, we build optimistic report if this is the first preview

const thread = ReportUtils.buildOptimisticChatReport(
participantAccountIDs,
props.translate(ReportActionsUtils.isSentMoneyReportAction(props.action) ? 'iou.threadSentMoneyReportName' : 'iou.threadRequestReportName', {
formattedAmount: ReportActionsUtils.getFormattedAmount(props.action),
comment: props.action.originalMessage.comment,
}),
'',
CONST.POLICY.OWNER_EMAIL_FAKE,
CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
false,
'',
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
props.action.reportActionID,
props.requestReportID,
);

Here is a bug. As you can see, ReportUtils.buildOptimisticChatReport has 12 parameters, but we call the function with only 11 parameters. We forgot to pass writeCapability and so the last 3 parameter values are wrong and the parentReportID of the new optimistic report is empty string.

Because of this, the parentReport below becomes {} and that's why ReportActionItemCreated is rendered instead of MoneyRequestView

const parentReport = ReportActionsUtils.getParentReportAction(props.report);

This is the root cause
This is a regression from this PR

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

We have to pass the writeCapability value in the ReportUtils.buildOptimisticChatReport function.

        const thread = ReportUtils.buildOptimisticChatReport(
            participantAccountIDs,
            props.translate(ReportActionsUtils.isSentMoneyReportAction(props.action) ? 'iou.threadSentMoneyReportName' : 'iou.threadRequestReportName', {
                formattedAmount: ReportActionsUtils.getFormattedAmount(props.action),
                comment: props.action.originalMessage.comment,
            }),
            '',
            CONST.POLICY.OWNER_EMAIL_FAKE,
            CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
            false,
            '',
            undefined,
            CONST.REPORT.WRITE_CAPABILITIES.ALL,
            CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
            props.action.reportActionID,
            props.requestReportID,
        );

This works perfect

What alternative solutions did you explore? (Optional)

@ayazhussain79
Copy link
Contributor

it is also reproducible when you click on "Reply in thread"

@Pujan92
Copy link
Contributor

Pujan92 commented Jul 26, 2023

Same RCA #23638

@ayazhussain79
Copy link
Contributor

@Pujan92 its not about console error or workspace please check the steps and also the bug title

@Pujan92
Copy link
Contributor

Pujan92 commented Jul 26, 2023

@ayazhussain79 I have mentioned here #23638 (comment) in the comment that for 3 flows the RCA seems to be the same(new workspace, request money action & child report navigation)

@ayazhussain79
Copy link
Contributor

And you can check that on slack i have reported this bug before this one #23638

@Pujan92
Copy link
Contributor

Pujan92 commented Jul 26, 2023

I am just trying to connect similar issues to avoid duplication. Definitely, the team will prioritize the earliest bug in that case.

@isabelastisser isabelastisser added Needs Reproduction Reproducible steps needed and removed Needs Reproduction Reproducible steps needed labels Jul 26, 2023
@isabelastisser
Copy link
Contributor

I can't reproduce it, I don't get the This is the beginning of your chat view when clicking on the amount requested, it works as expected for me. Closing!

@ayazhussain79
Copy link
Contributor

@isabelastisser please try that on latest main branch code its still reproducible
You can also reproduce it on dev using these steps:

  1. Open a chat
  2. Send a message and click on "Reply in thread"

@ayazhussain79
Copy link
Contributor

@Pujan92 @s-alves10 are you guys able to reproduce it right?

@ayazhussain79
Copy link
Contributor

@isabelastisser can you please check that again? now it is reproducible on staging

@s-alves10
Copy link
Contributor

@ayazhussain79

Please check #23638. Someone is working on this

@ayazhussain79
Copy link
Contributor

@s-alves10 Thank you commented there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

5 participants