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] [Tags] Newly added tag status is disabled and refreshing the page changes to enabled #38265

Closed
6 tasks done
m-natarajan opened this issue Mar 14, 2024 · 19 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Mar 14, 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: 1.4.52-0
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: n/a
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 admin of Collect workspace.
  1. Go to staging.new.expensify.com.
  2. Go to Settings > Workspaces > Collect workspace.
  3. Go to Categories.
  4. Click Add category and add a category.
  5. Note that the status of the new category is "Enabled".
  6. Go to Tags.
  7. Click Add tag and add a tag. observe the status of the tag
  8. As employee, initiate a expense report flow and click on the tag
    OR
  9. Refresh the page at the step 7

Expected Result:

Newly added tag should be enabled by default or the tag should not show for employee since it is disabled by default

Actual Result:

  • New tag status is disabled and when refreshing the page it changes to enabled
  • For employee the added tag showing to select

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

Bug6412863_1710369795480.bandicam_2024-03-14_04-42-11-264.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010353991d7fc3df7f
  • Upwork Job ID: 1768104273053810688
  • Last Price Increase: 2024-03-14
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Mar 14, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Mar 14, 2024

Triggered auto assignment to @robertjchen (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@neonbhai
Copy link
Contributor

Proposal

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

Newly added tag status is disabled and refreshing the page changes to enabled

What is the root cause of that problem?

We disable the newly added Tag optimistically in createPolicyTag here:

App/src/libs/actions/Policy.ts

Lines 2776 to 2778 in 13f8bc0

[tagName]: {
name: tagName,
enabled: false,

But the backend enables all new tags, like we do with all new categories. Also in OldDot newly added Tags are enabled.
So when refreshing the backend updates the status of the tag to enabled.

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

We should enable the newly added Tag here to not have discrepancy with the backend:

enabled: false,

Similar to how we enable newly added Categories here:

App/src/libs/actions/Policy.ts

Lines 2722 to 2724 in 13f8bc0

[categoryName]: {
name: categoryName,
enabled: true,

@robertjchen robertjchen added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

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

@melvin-bot melvin-bot bot changed the title Newly added tag status is disabled and refreshing the page changes to enabled [$500] Newly added tag status is disabled and refreshing the page changes to enabled Mar 14, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

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

@robertjchen robertjchen changed the title [$500] Newly added tag status is disabled and refreshing the page changes to enabled [$250] Newly added tag status is disabled and refreshing the page changes to enabled Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

Upwork job price has been updated to $250

@robertjchen
Copy link
Contributor

Not a deploy blocker. Opening for External Contributors

@Tony-MK

This comment was marked as resolved.

@jeremy-croff
Copy link
Contributor

The requirements for this are unclear as there's no real precedence. Should the default state of tags be enabled, or disabled, and the BE shouldn't be enabling it?

There's a design doc on this in here #37311 but I don't have access. Is this experience confirmed?

@robertjchen
Copy link
Contributor

@jeremy-croff Good point! cc: @luacmartins for clarification on the proper behavior here 🙏

@askavyblr
Copy link

askavyblr commented Mar 14, 2024

Proposal

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

The newly added tag status is disabled and refreshing the page changes to enabled

What is the root cause of that problem?

Tags are initially disabled by default when created by the user. Upon refreshing the page, an API call is triggered with the command "OpenPolicyTagsPage," which subsequently enables the tags.

JSON "key": "policyTags_5E9B96705932918F", "onyxMethod": "set", "value": { "Tag": { "name": "Tag", "orderWeight": 0, "required": true, "tags": { "PPP": { "enabled": true, "name": "PPP" }, "Tag1": { "enabled": true, "name": "Tag1" }, "Tag2": { "enabled": true, "name": "Tag2" }, "Test": { "enabled": true, "name": "Test" }, "Testaaa": { "enabled": true, "name": "Testaaa" }, "test2": { "enabled": true, "name": "test2" }

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

App/src/libs/actions/Policy.ts

Lines 2777 to 2778 in b7a230e

name: tagName,
enabled: false,

In the createPolicyTag function, set enabled: true

@luacmartins
Copy link
Contributor

Thanks for the ping. We'll address this in a follow up PR since this feature is still WIP. cc @waterim all tags should be enabled by default.

@luacmartins luacmartins removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 14, 2024
@luacmartins luacmartins self-assigned this Mar 14, 2024
@robertjchen robertjchen removed their assignment Mar 18, 2024
@laurenreidexpensify
Copy link
Contributor

@rushatgabhane bump for review of proposals ^^

@laurenreidexpensify
Copy link
Contributor

Oh completely misread the above - @luacmartins is taking this on, so we don't need a proposal review of externals.

@laurenreidexpensify
Copy link
Contributor

@trjExpensify adding to wave-collect as this is tag related

@trjExpensify trjExpensify changed the title [$250] Newly added tag status is disabled and refreshing the page changes to enabled [$250] [Tags] Newly added tag status is disabled and refreshing the page changes to enabled Mar 21, 2024
@trjExpensify
Copy link
Contributor

Noice!

@luacmartins
Copy link
Contributor

PR up!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 21, 2024
@luacmartins
Copy link
Contributor

Gonna close this issue in favor of #38192

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

10 participants