Skip to content

[HOLD for payment 2024-02-07] [$500] Tag - Custom name for tag in tag edit message reverts to "tag" after relogin #33493

Closed

Description

@lanitochka17

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: 1.4.16-3
Reproducible in staging?: Y
Reproducible in production?: Y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Precondition:

  • User is an employee of a Collect workspace on OD
  • The Collect workspace has custom name for Tag
  1. Go to the workspace chat
  2. Create a manual request with an assigned tag
  3. Open request details page
  4. Click on tag
  5. Select a different tag
  6. Log out and log in again
  7. Navigate to the same request details page in Step 3

Expected Result:

The custom name for tag in tag edit message remains as the custom name after relogin

Actual Result:

The custom name for tag in tag edit message reverts to "Tag" after relogin

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

Bug6323999_1703252410585.bandicam_2023-12-22_12-19-20-744.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012b6267e4a0f872d1
  • Upwork Job ID: 1738202853693796352
  • Last Price Increase: 2024-01-05
  • Automatic offers:
    • jjcoffee | Reviewer | 28094836
    • hoangzinh | Contributor | 28094837
Issue OwnerCurrent Issue Owner: @miljakljajic

Activity

  1. added
    External
    Daily
    Bug
    on Dec 22, 2023
  2. changed the title [-]Tag - Custom name for tag in tag edit message reverts to "tag" after relogin[/-] [+][$500] Tag - Custom name for tag in tag edit message reverts to "tag" after relogin[/+] on Dec 22, 2023
  3. melvin-bot commented on Dec 22, 2023

    @melvin-bot
  4. melvin-bot commented on Dec 22, 2023

    @melvin-bot

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

  5. added
    Help Wanted
    on Dec 22, 2023
  6. melvin-bot commented on Dec 22, 2023

    @melvin-bot

    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
  7. melvin-bot commented on Dec 22, 2023

    @melvin-bot

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

  8. hoangzinh commented on Dec 22, 2023

    @hoangzinh
    Contributor

    Proposal

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

    Tag - Custom name for tag in tag edit message reverts to "tag" after relogin

    What is the root cause of that problem?

    • We're using ModifiedExpenseMessage.getForReportAction to build modified expense messages, and we're getting reportID from reportAction then get name of tags
      const policyID = ReportUtils.getReportPolicyID(reportAction.reportID) ?? '';
      const policyTags = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {};
      const policyTagListName = PolicyUtils.getTagListName(policyTags) || Localize.translateLocal('common.tag');

    Unluckily, reportActions of MODIFIEDEXPENSE type don't have reportID property so based on above line of code, it can't retrieve the policyID => can't retrieve the name of tag of that policy => return the default name of tag ("Tag") at line 103 above.

    Screenshot 2023-12-22 at 22 33 06
    • We can see the custom name of tag after modifying the tag of an expense report because in the buildOptimisticModifiedExpenseReportAction function, we already add the reportID. But after relogin, this will be reset with the response from BE.

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

    1. I think we can pass an additional param, the reportID to function ModifiedExpenseMessage.getForReportAction, then use it to retrieve the custom name of tag.

    There are several places we need to update:

    children = <ReportActionItemBasicMessage message={ModifiedExpenseMessage.getForReportAction(props.action)} />;

    const properSchemaForModifiedExpenseMessage = ModifiedExpenseMessage.getForReportAction(lastReportAction);

    const body = ModifiedExpenseMessage.getForReportAction(reportAction);

    const modifyExpenseMessage = ModifiedExpenseMessage.getForReportAction(reportAction);

    1. To keep it consistent, we should remove reportID from the optimistic data here
      reportID: transactionThread?.reportID,

    Demo:

    Screen.Recording.2024-01-10.at.21.34.01.mp4
  9. dukenv0307 commented on Dec 26, 2023

    @dukenv0307
    Contributor

    Proposal

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

    Custom name for tag in tag edit message reverts to "tag" after relogin

    What is the root cause of that problem?

    The modified action has reportID in optimisticData here but after relogin, BE doesn't return reportID for this action.

    reportID: transactionThread?.reportID,

    And then we can not get policyID of transaction thread report via reportAction.reportID

    const policyID = ReportUtils.getReportPolicyID(reportAction.reportID) ?? '';

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

    Seem like reportID field doesn't exist from action in BE, we should remove this field in optimistic data here and remove the use of reportAction.reportID.

    reportID: transactionThread?.reportID,

    And we should pass reportID to getForReportAction and use this to get the policy of this report.

    const policyID = ReportUtils.getReportPolicyID(reportAction.reportID) ?? '';

    What alternative solutions did you explore? (Optional)

  10. melvin-bot commented on Dec 26, 2023

    @melvin-bot

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

  11. 33 remaining items

  12. jjcoffee commented on Jan 25, 2024

    @jjcoffee
    Contributor

    PR is in review, just waiting for @hoangzinh to answer a question.

  13. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Jan 31, 2024
  14. changed the title [-][$500] Tag - Custom name for tag in tag edit message reverts to "tag" after relogin[/-] [+][HOLD for payment 2024-02-07] [$500] Tag - Custom name for tag in tag edit message reverts to "tag" after relogin[/+] on Jan 31, 2024
  15. removed
    Reviewing
    on Jan 31, 2024
  16. melvin-bot commented on Jan 31, 2024

    @melvin-bot

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

  17. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.33-5 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-02-07. 🎊

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

  18. melvin-bot commented on Jan 31, 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:

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

    @jjcoffee
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: ReportAction text for transactions edited in OldDot #30603
    • 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: https://github.com/Expensify/App/pull/30603/files#r1478371558
    • 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
    • Determine if we should create a regression test for this bug. Yes
    • 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.

    Regression Test Proposal

    1. Go to the workspace chat
    2. Create a manual request with an assigned tag
    3. Open request details page
    4. Select a different tag
    5. Verify that the modified expense message shows with a custom name for Tag (I.e "changed the CTag to...")
    6. Log out and log in again
    7. Verify that the modified expense message shows with a custom name for Tag (I.e "changed the CTag to...")

    Do we agree 👍 or 👎

  20. added
    Daily
    and removed
    Weekly
    on Feb 6, 2024
  21. tgolen commented on Feb 6, 2024

    @tgolen
    Contributor

    Sounds good to me 👍

  22. miljakljajic commented on Feb 7, 2024

    @miljakljajic
    Contributor

    Test rail issue submitted, contributors paid, contracts closed. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions