Skip to content

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

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 19, 2024
  2. melvin-bot commented on Nov 19, 2024

    @melvin-bot

    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.

  3. mkzie2 commented on Nov 19, 2024

    @mkzie2
    Contributor

    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)

  4. FitseTLT commented on Nov 19, 2024

    @FitseTLT
    Contributor

    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)

  5. stephanieelliott commented on Nov 22, 2024

    @stephanieelliott
    Contributor

    Tested and confirmed that the language on system messages should update

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 22, 2024
  7. melvin-bot commented on Nov 22, 2024

    @melvin-bot
  8. 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[/+] on Nov 22, 2024
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 22, 2024
  10. melvin-bot commented on Nov 22, 2024

    @melvin-bot

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

  11. dukenv0307 commented on Nov 24, 2024

    @dukenv0307
    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?

  12. mkzie2 commented on Nov 24, 2024

    @mkzie2
    Contributor

    @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

  13. 43 remaining items

  14. melvin-bot commented on Dec 23, 2024

    @melvin-bot

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

  15. melvin-bot commented on Dec 25, 2024

    @melvin-bot

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

  16. melvin-bot commented on Dec 27, 2024

    @melvin-bot

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

  17. melvin-bot commented on Dec 31, 2024

    @melvin-bot

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

  18. melvin-bot commented on Jan 3, 2025

    @melvin-bot

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

  19. stephanieelliott commented on Jan 6, 2025

    @stephanieelliott
    Contributor

    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

  20. moved this from Hold for Payment to Done in #expensify-bugson Jan 6, 2025
  21. JmillsExpensify commented on Feb 10, 2025

    @JmillsExpensify
    Contributor

    @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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions