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-06-28] [$250] Tags - Enable tag option is no longer grayed out after renaming tag offline #42917

Closed
6 tasks done
lanitochka17 opened this issue May 31, 2024 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented May 31, 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: 1.4.78-0
Reproducible in staging?: Y
Reproducible in production?: 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/4587701
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go offline
  3. Go to workspace settings
  4. Go to Tags
  5. Click on any tag
  6. Disable or enable the tag
  7. Note that the option grays out
  8. Click on the tag name
  9. Rename the tag

Expected Result:

Enable tag option will remain grayed out after renaming tag offline

Actual Result:

Enable tag option is no longer grayed out after renaming tag offline

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

Bug6497093_1717139350416.20240531_150625.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014348229109c8ccb2
  • Upwork Job ID: 1798333089478942720
  • Last Price Increase: 2024-06-05
  • Automatic offers:
    • Krishna2323 | Contributor | 102678138
    • allgandalf | Contributor | 102763005
Issue OwnerCurrent Issue Owner: @garrettmknight
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 31, 2024
Copy link

melvin-bot bot commented May 31, 2024

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

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@Krishna2323
Copy link
Contributor

Krishna2323 commented May 31, 2024

Proposal

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

Tags - Enable tag option is no longer grayed out after renaming tag offline

What is the root cause of that problem?

The current pending actions are replaced by new pending actions.

pendingFields: {
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},

pendingFields: {
enabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},

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

We need to spread the oldTag?.pendingFields in renamePolicyTag and ...(policyTag.tags[key]).pendingFields in setWorkspaceTagEnabled.

We will also need to give a type for oldTag in renamePolicyTag and then spread in pendingFields. For setWorkspaceTagEnabled we can directly spread ...policyTag.tags[key].pendingFields,.

const oldTag: PolicyTag | Record<string, never> = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[tagListName]?.tags?.[oldTagName] ?? {};

pendingFields: {
    ...(oldTag.pendingFields ?? {}),
    name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},

We will also spread the previous pending field in success and failure data.

We will also check for similar bugs in policy pages or pages with similar functionality.

What alternative solutions did you explore? (Optional)

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Minor updates in solution section

@melvin-bot melvin-bot bot added the Overdue label Jun 3, 2024
@garrettmknight
Copy link
Contributor

I couldn't get the tag to disable offline when testing. @Krishna2323 are you getting a different result on Step 6?

@garrettmknight garrettmknight added retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause and removed Overdue labels Jun 3, 2024
@Krishna2323
Copy link
Contributor

@garrettmknight, yup I can disable the tag, the updated styles (grayed out) is applied to switch until we edit the tag name. Both should be grayed out, but switch returns to normal state as if it wasn't updated offline.

Monosnap.screencast.2024-06-05.02-01-51.mp4

@garrettmknight
Copy link
Contributor

Cool - just replicated, opening up.

@garrettmknight garrettmknight added External Added to denote the issue can be worked on by a contributor and removed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Jun 5, 2024
@melvin-bot melvin-bot bot changed the title Tags - Enable tag option is no longer grayed out after renaming tag offline [$250] Tags - Enable tag option is no longer grayed out after renaming tag offline Jun 5, 2024
Copy link

melvin-bot bot commented Jun 5, 2024

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

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

melvin-bot bot commented Jun 5, 2024

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

@garrettmknight garrettmknight moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #wave-collect Jun 5, 2024
@cretadn22
Copy link
Contributor

Proposal

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

Enable tag option is no longer grayed out after renaming tag offline

What is the root cause of that problem?

When renaming the tag, we remove the old Tag and add the new tag. pendingFields of new tag will override the pendingFields of oldTag, so pendingFields.enable is lost

[oldTagName]: null,
[newTagName]: {
...oldTag,
name: newTagName,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},

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

In renamePolicyTag function, we need to make adjustments to these points:

  • OptimisticData: Instead of completely overriding pendingFields, we need to perform a deep merge to combine the pending fields
pendingFields: merge(oldTag.pendingFields, {
   name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
})
  • SuccessData:

[newTagName]: {
errors: null,
pendingAction: null,
pendingFields: {
name: null,

We utilize oldTag.errors, errors.pendingAction, and oldTag.pendingFields.

errors: oldTag.errors, 
pendingAction: oldTag.pendingAction, 
pendingFields: oldTag.pendingFields

  • FailureData: we need to deep merge the error object
    [oldTagName]: {
    ...oldTag,
    errors: ErrorUtils.getMicroSecondOnyxError('workspace.tags.genericFailureMessage'),
errors: merge(oldTag.errors, {
    ErrorUtils.getMicroSecondOnyxError('workspace.tags.genericFailureMessage')
})

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot added the Overdue label Jun 7, 2024
@garrettmknight
Copy link
Contributor

@thesahindia looks like we've got a proposal here!

@melvin-bot melvin-bot bot removed the Overdue label Jun 7, 2024
@thesahindia
Copy link
Member

thesahindia commented Jun 7, 2024

@Krishna2323's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 7, 2024

Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Krishna2323
Copy link
Contributor

@thesahindia, PR ready for review.

@thesahindia thesahindia removed their assignment Jun 14, 2024
@allgandalf
Copy link
Contributor

@garrettmknight , can you please assign me here(context), I’ll be reviewing the PR

Copy link

melvin-bot bot commented Jun 17, 2024

📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [$250] Tags - Enable tag option is no longer grayed out after renaming tag offline [HOLD for payment 2024-06-28] [$250] Tags - Enable tag option is no longer grayed out after renaming tag offline Jun 21, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

Copy link

melvin-bot bot commented Jun 21, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-7 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-06-28. 🎊

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

Copy link

melvin-bot bot commented Jun 21, 2024

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:

  • [@allgandalf] The PR that introduced the bug has been identified. Link to the PR:
  • [@allgandalf] 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:
  • [@allgandalf] 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:
  • [@allgandalf] Determine if we should create a regression test for this bug.
  • [@allgandalf] 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.
  • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 27, 2024
@garrettmknight
Copy link
Contributor

Payment Summary:

@allgandalf can you complete the checklist when you get a chance?

@garrettmknight garrettmknight added the Weekly KSv2 label Jun 28, 2024
@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@garrettmknight
Copy link
Contributor

Shouldn't be overdue?

@melvin-bot melvin-bot bot removed the Overdue label Jul 1, 2024
@allgandalf
Copy link
Contributor

completing the checklist @garrettmknight , should update this in sometime, sorry my K2 api token expired and this didn't update in my K2 at all whole week :)

@allgandalf allgandalf mentioned this issue Jul 2, 2024
50 tasks
@allgandalf
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:

  • 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:

  • 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:

    • That was a new feature Implementation, so it would not have been possible to avoid this current bug, so N/A.
  • 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:

    • That was a new feature Implementation, so it would not have been possible to avoid this current bug, so N/A
  • 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


  • Precondition: Workspace must have few tags.
  1. Go offline
  2. Go to workspace settings
  3. Go to Tags
  4. Click on any tag
  5. Disable or enable the tag
  6. Note that the option grays out
  7. Click on the tag name
  8. Rename the tag
  9. Verify both switch and name field is grayed out

Do we agree 👍 or 👎

@garrettmknight
Copy link
Contributor

Done!

@github-project-automation github-project-automation bot moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #wave-collect Jul 2, 2024
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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants