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

[$250] Chat - Missing start convo message and description room changes to a code #50168

Closed
2 of 6 tasks
lanitochka17 opened this issue Oct 3, 2024 · 20 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 3, 2024

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: 9.0.44
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Create a new chat room
  2. Send a message

Expected Result:

The start conversation message is displayed below the Welcome message and the description room remains unchanged when the user performs any activity in the room

Actual Result:

The start conversation message is not displayed below the Welcome message
The description room changes to a code when the user sends a 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

Add any screenshot/video evidence
Bug6623406_1727972187362.49911-Web.mp4
Bug6623406_1727972187307.49911-mWeb.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021842271623775763004
  • Upwork Job ID: 1842271623775763004
  • Last Price Increase: 2024-10-11
Issue OwnerCurrent Issue Owner: @rushatgabhane
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

Triggered auto assignment to @joekaufmanexpensify (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.

@lanitochka17
Copy link
Author

@joekaufmanexpensify 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

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Missing start convo message and description room changes to a code

What is the root cause of that problem?

Issue 1: Missing start convo message
We do early return here if description exist so the 'welcomeMessage.phrase2' not populated

return welcomeMessage;

And if welcomeMessage?.messageHtml exist we just show that without showing the start convo message

<PressableWithoutFeedback
onPress={() => {
const activeRoute = Navigation.getReportRHPActiveRoute();
if (ReportUtils.canEditReportDescription(report, policy)) {
Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report?.reportID ?? '-1', activeRoute));
return;
}
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID ?? '-1', activeRoute));
}}
style={styles.renderHTML}
accessibilityLabel={translate('reportDescriptionPage.roomDescription')}
>
<RenderHTML html={welcomeMessage.messageHtml} />
</PressableWithoutFeedback>
) : (
<Text>
<Text>{welcomeMessage.phrase1}</Text>
{welcomeMessage.showReportName && (
<Text
style={[styles.textStrong]}
onPress={navigateToReport}
suppressHighlighting
>
{ReportUtils.getReportName(report)}
</Text>
)}
{welcomeMessage.phrase2 !== undefined && <Text>{welcomeMessage.phrase2}</Text>}
</Text>
))}

Issue 2: description room changes to a code
The description value from the API response is like the following, and we don't format it
image

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

For Issue 1, I think it is intentional to not showing the start convo message if the description is exist. But if we want to always show the start convo message we can remove this return and update this to the following

{isChatRoom && (
                    <>
                        <Text>
                            <Text>{welcomeMessage?.phrase1}</Text>
                            {welcomeMessage?.showReportName && (
                                <Text
                                    style={[styles.textStrong]}
                                    onPress={navigateToReport}
                                    suppressHighlighting
                                >
                                    {ReportUtils.getReportName(report)}
                                </Text>
                            )}
                            {welcomeMessage?.phrase2 !== undefined && <Text>{welcomeMessage.phrase2}</Text>}
                        </Text>
                        {welcomeMessage?.messageHtml && (
                            <PressableWithoutFeedback
                                onPress={() => {
                                    const activeRoute = Navigation.getReportRHPActiveRoute();
                                    if (ReportUtils.canEditReportDescription(report, policy)) {
                                        Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report?.reportID ?? '-1', activeRoute));
                                        return;
                                    }
                                    Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID ?? '-1', activeRoute));
                                }}
                                style={styles.renderHTML}
                                accessibilityLabel={translate('reportDescriptionPage.roomDescription')}
                            >
                                <RenderHTML html={welcomeMessage.messageHtml} />
                            </PressableWithoutFeedback>
                        )}
                    </>
                )}

For issue 2, I think we can fix it on BE. But if we want to fix on FE we can do it like the following

       try {
            const parsedDescription = JSON.parse(report.description);
            welcomeMessage.messageHtml = parsedDescription?.html ?? report.description;
        } catch (error) {
            welcomeMessage.messageHtml = report.description;
        }

and need to be fixed in other places where the room description is displayed as well

What alternative solutions did you explore? (Optional)

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 4, 2024
@melvin-bot melvin-bot bot changed the title Chat - Missing start convo message and description room changes to a code [$250] Chat - Missing start convo message and description room changes to a code Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

@joekaufmanexpensify
Copy link
Contributor

Pending review of proposal

@melvin-bot melvin-bot bot added the Overdue label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

@rushatgabhane, @joekaufmanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@truph01
Copy link
Contributor

truph01 commented Oct 7, 2024

@joekaufmanexpensify Can you confirm the expected behavior here: Do we want to display both room's description and start conversation message? Currently in staging, if room's description is existed, we don't display the start conversation message

@joekaufmanexpensify
Copy link
Contributor

I don't think we should change that behavior. I would focus just on the scope of the issue in OP.

@truph01
Copy link
Contributor

truph01 commented Oct 8, 2024

I don't think we should change that behavior. I would focus just on the scope of the issue in OP.

@joekaufmanexpensify If so, we just need to fix "The description room changes to a code when the user sends a message", which is dupe of #49355

@joekaufmanexpensify
Copy link
Contributor

Ah, hmm. Let me investigate a bit further then.

Copy link

melvin-bot bot commented Oct 8, 2024

@rushatgabhane, @joekaufmanexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@joekaufmanexpensify
Copy link
Contributor

@joekaufmanexpensify Can you confirm the expected behavior here: Do we want to display both room's description and start conversation message? Currently in staging, if room's description is existed, we don't display the start conversation message

@truph01 are you seeing that this was recently introduced somewhere in a specific PR? Or just became aware of this as part of this issue.

Copy link

melvin-bot bot commented Oct 10, 2024

@rushatgabhane, @joekaufmanexpensify Eep! 4 days overdue now. Issues have feelings too...

@joekaufmanexpensify
Copy link
Contributor

@truph01 could you confirm this when you have a sec?

Copy link

melvin-bot bot commented Oct 11, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@truph01
Copy link
Contributor

truph01 commented Oct 11, 2024

@truph01 are you seeing that this was recently introduced somewhere in a specific PR? Or just became aware of this as part of this issue.

  • In staging, if room does not have description, we display the text "This chat room is for anything test-room related". Otherwise, we display the room's description instead. But now I can't find which PR introduced this behavior.

  • In the expected section of this issue, "The start conversation message is displayed below the Welcome message"

So, what is the intended behavior here? Should we keep it as it currently is, or switch to the new expected behavior outlined in this issue?

@joekaufmanexpensify
Copy link
Contributor

In staging, if room does not have description, we display the text "This chat room is for anything test-room related". Otherwise, we display the room's description instead. But now I can't find which PR introduced this behavior.

I just tested this behavior. It works identically on staging and production.

@joekaufmanexpensify
Copy link
Contributor

In the expected section of this issue, "The start conversation message is displayed below the Welcome message"

I think the OP was wrong here. I found this issue where we made it so the room description is shown as the welcome message for the room when one is set.

@joekaufmanexpensify
Copy link
Contributor

Therefore, I think the only issue here to address would be showing the code in the room description, which like you said is a dupe of the other issue linked above. So closing this as seems like there is nothing to handle here!

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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Development

No branches or pull requests

5 participants