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

[HOLD for payment 2024-12-19] [$250] Preferences - When changing language, message about removed users is not changed in LHN #52775

Closed
5 of 8 tasks
IuliiaHerets opened this issue Nov 19, 2024 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 19, 2024

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.64-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5242214&group_by=cases:section_id&group_order=asc&group_id=229064
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Open any group chat.
  3. Tap on the header and select "Members"
  4. Remove members from the group.
  5. Verify a system message is displayed showing this action and that the same message is seen on chat preview.
  6. Tap on "Settings" on the bottom of the page.
  7. Tap on "Preferences" and select "Language"
  8. Change language to Spanish.
  9. Return to inbox and verify that the preview of the group chat was updated to this change, and the system message on chat too.

Expected Result:

When changing language to spanish, the system message showing the action of removing group members and the preview of the chat on LHN, should be updated to this change.

Actual Result:

Message about removed members of a group in chat preview on LHN, is not updated to the language change.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6669579_1732026214491.Removed.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859794304218279153
  • Upwork Job ID: 1859794304218279153
  • Last Price Increase: 2024-12-06
  • Automatic offers:
    • mkzie2 | Contributor | 105230840
Issue OwnerCurrent Issue Owner: @stephanieelliott
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-12-04 03:51:21 UTC.

Proposal

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

Message about removed members of a group in chat preview on LHN, is not updated to the language change.

What is the root cause of that problem?

We already have a case for REMOVEFROMROOM action with isInviteOrRemovedAction check here.

} else if (ReportActionsUtils.isInviteOrRemovedAction(lastAction)) {
const lastActionOriginalMessage = lastAction?.actionName ? ReportActionsUtils.getOriginalMessage(lastAction) : null;
const targetAccountIDs = lastActionOriginalMessage?.targetAccountIDs ?? [];

But the group chat report doesn't move to this block because this condition here

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.private_isArchived) {

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

We should add a case for a group chat report here

const isGroupChat = ReportUtils.isGroupChat(report) || ReportUtils.isDeprecatedGroupDM(report);
if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage || isGroupChat) && !result.private_isArchived) {

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.private_isArchived) {

What alternative solutions did you explore? (Optional)

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 16:29:32 UTC.

Proposal

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

Preferences - When changing language, message about removed users is not changed in LHN

What is the root cause of that problem?

We are displaying a properly constructed and translated text in ReportActionItemMessage here

if (ReportActionsUtils.isMemberChangeAction(action)) {

But we have forgotten to make the same translation in two places by handling isInviteOrRemovedAction case specifically

  1. In LHN: Although we are handling the case for isInviteOrRemovedAction here
    } else if (ReportActionsUtils.isInviteOrRemovedAction(lastAction)) {
    const lastActionOriginalMessage = lastAction?.actionName ? ReportActionsUtils.getOriginalMessage(lastAction) : null;

    It will not reach it as we haven't included isGroupChat condition here
    if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.private_isArchived) {
  2. In chat thread header title: if we create a thread with the removed system action the chat thread report header title will not have the proper translated text matching with the report action itself as we didn't handle the case in getReportName here as we did for other exceptional report action cases
    if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isModifiedExpenseAction(parentReportAction)) {

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

  1. We can add the isGroupChat condition in here but I don't think we want to allow group chat reports case to pass through the unwanted code section that we are now avoiding currently for group chats so we should add isGroupChat condition and only for this specific case of isInviteOrRemovedAction here
    if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.private_isArchived) {
...
result.isTaskReport ||
            ((ReportUtils.isGroupChat(report) || ReportUtils.isDeprecatedGroupDM(report)) && ReportActionsUtils.isInviteOrRemovedAction(lastAction)) ||
            isThreadMessage)
...

But if we are ok with passing through the code section we will also need to move the code that precedes it with lastActorDisplayName for group chat case from here to here
2. We should handle the isInviteOrRemovedAction in getReportName here

if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isModifiedExpenseAction(parentReportAction)) {

 if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isMemberChangeAction(parentReportAction)) {
            const elemets = ReportActionsUtils.getMemberChangeMessageElements(parentReportAction);
            const actionMessage = elemets.map((element) => element.content).join('');
            return formatReportLastMessageText(actionMessage);
        }

we can also optionally parse Parser.htmlToText what is returned from ReportActionsUtils.getMemberChangeMessageFragment(action).html

What alternative solutions did you explore? (Optional)

@stephanieelliott
Copy link
Contributor

Tested and confirmed that the language on system messages should update

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

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

@melvin-bot melvin-bot bot changed the title Preferences - When changing language, message about removed users is not changed in LHN [$250] Preferences - When changing language, message about removed users is not changed in LHN Nov 22, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

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

@dukenv0307
Copy link
Contributor

@mkzie2

and handle this case here

Why do we need to handle this case here? If we move isGroupChat to if block, it will be false in else block. Please correct me if I miss sth

@FitseTLT

I don't think we want to allow group chat reports case to pass through the unwanted code section that we are now avoiding currently for group chats

Can you show me the reason why we are doing that?

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 24, 2024

@dukenv0307 For group chat, we want to show the lastActorDisplayName with the lastMessageText then we need to update the condition handle this case as well for group chat.

Another note: Add group chat to this case will be safe because some actions are handled the same with getLastMessageTextForReport and some other actions don't exist in group chat

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 24, 2024

@FitseTLT

I don't think we want to allow group chat reports case to pass through the unwanted code section that we are now avoiding currently for group chats

Can you show me the reason why we are doing that?

@dukenv0307 I am not insisting on it, I am just mentioning it as an option as adding only isGroupChat condition might not be desirable to fix problem for one type of action as it will force it to pass through a code section that handles many other types of actions although most of the actions are more or less room and policy related except may be this one

} else if (ReportActionsUtils.isTaskAction(lastAction)) {

if we also want the task actions handled similarly for group chats too we are good to go but in that case we will also need to move the code that precedes it with lastActorDisplayName for group chat case from here to here I have updated my proposal with this additional changed needed in case we are ok with passing through the code section 👍
However, the most important thing we should also handle is to fix getReportName as I mentioned in my proposal as without it the chat thread header name will mismatch the report action displayed 👍

Copy link

melvin-bot bot commented Nov 27, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 27, 2024
Copy link

melvin-bot bot commented Nov 29, 2024

@stephanieelliott, @dukenv0307 Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Nov 29, 2024

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

@dukenv0307
Copy link
Contributor

will give the update by EOD

@melvin-bot melvin-bot bot removed the Overdue label Nov 30, 2024
@dukenv0307
Copy link
Contributor

@mkzie2 Can we just move the isGroup chat logic to

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.private_isArchived) {

For the logic, we already handle it in here

@FitseTLT

as I mentioned in my proposal as without it we would be causing a regression where the chat thread header name will mismatch the report action displayed

I think this bug is out of scope and already happens on staging, not after applying your first point.

Pls correct me if I missed sth.

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 30, 2024

@mkzie2 Can we just move the isGroup chat logic to

@dukenv0307 Checked again and you're correct, we can simply add isGroupChat to this logic.

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 30, 2024

I think this bug is out of scope and already happens on staging, not after applying your first point.

Pls correct me if I missed sth.

Yes it might not be a regression but the root cause of the problem is when they implemented the translation of the report action they only implemented for ReportActionItem and copy to clipboard and LHN (excluding group chat) and forgot for thread header title getReportName and I can't see that out of the scope of this issue and it is closely related to the deep root cause of the issue.

@mkzie2
Copy link
Contributor

mkzie2 commented Dec 2, 2024

I don't think it's in the scope of the issue.

  1. The messages we handle in LHN and the Report screen differ. We're fixing the bug in LHN, not in the Report screen.

I can't see that out of the scope of this issue and it is closely related to the deep root cause of the issue.

  1. Based on the deep root cause, the problem isn't that we don't handle the translation case for this action. We handled it here.

} else if (ReportActionsUtils.isInviteOrRemovedAction(lastAction)) {
const lastActionOriginalMessage = lastAction?.actionName ? ReportActionsUtils.getOriginalMessage(lastAction) : null;
const targetAccountIDs = lastActionOriginalMessage?.targetAccountIDs ?? [];

The RCA is just we don't include the group chat report in this case.

cc @dukenv0307

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

@stephanieelliott @dukenv0307 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Dec 3, 2024

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

@stephanieelliott
Copy link
Contributor

Hey @dukenv0307 what's the next step here, are we still waiting for different proposals?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 7, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Dec 7, 2024

@dukenv0307 The PR is here.

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 10, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 12, 2024
@melvin-bot melvin-bot bot changed the title [$250] Preferences - When changing language, message about removed users is not changed in LHN [HOLD for payment 2024-12-19] [$250] Preferences - When changing language, message about removed users is not changed in LHN Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.74-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-12-19. 🎊

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

Copy link

melvin-bot bot commented Dec 12, 2024

@dukenv0307 @stephanieelliott @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Dec 17, 2024
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 18, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

@marcochavezf, @stephanieelliott, @dukenv0307, @mkzie2 Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Dec 25, 2024

@marcochavezf, @stephanieelliott, @dukenv0307, @mkzie2 Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Dec 27, 2024

@marcochavezf, @stephanieelliott, @dukenv0307, @mkzie2 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Dec 31, 2024

@marcochavezf, @stephanieelliott, @dukenv0307, @mkzie2 12 days overdue. Walking. Toward. The. Light...

@melvin-bot melvin-bot bot removed the Daily KSv2 label Jan 3, 2025
Copy link

melvin-bot bot commented Jan 3, 2025

This issue has not been updated in over 14 days. @marcochavezf, @stephanieelliott, @dukenv0307, @mkzie2 eroding to Weekly issue.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Overdue labels Jan 3, 2025
@stephanieelliott
Copy link
Contributor

stephanieelliott commented Jan 6, 2025

Summarizing payment on this issue:

  • Contributor: @mkzie2 $250 via Upwork -- PAID
  • Contributor+: @dukenv0307 $250 via ND -- please request!

Upwork job is here: https://www.upwork.com/jobs/~021859794304218279153

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Jan 6, 2025
@JmillsExpensify
Copy link

@stephanieelliott mind updating that summary with the amount please? In the meantime, $250 approved for @dukenv0307.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

8 participants