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] Category - Description hint field shows previous data after reenabling "Require description" #52399

Open
5 of 8 tasks
IuliiaHerets opened this issue Nov 12, 2024 · 27 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 12, 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: 9.0.60-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Rules are enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Click on any category.
  4. Enable "Require description".
  5. Click Description hint.
  6. Enter anything and save it.
  7. Disable "Require description".
  8. Enable "Require description".
  9. Note that Description hint field is empty.
  10. Dismiss the RHP.
  11. Click on the same category.

Expected Result:

Description hint field will remain empty.

Actual Result:

Description hint field shows the previous data after reopening category settings.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6662259_1731402885400.20241112_171047.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021858724639436105772
  • Upwork Job ID: 1858724639436105772
  • Last Price Increase: 2024-11-26
Issue OwnerCurrent Issue Owner: @parasharrajat
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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

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

melvin-bot bot commented Nov 18, 2024

@strepanier03 Eep! 4 days overdue now. Issues have feelings too...

@strepanier03
Copy link
Contributor

I was able to reproduce this and have tied it to a project. Setting external now.

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@strepanier03 strepanier03 added External Added to denote the issue can be worked on by a contributor Overdue labels Nov 19, 2024
@melvin-bot melvin-bot bot changed the title Category - Description hint field shows previous data after reenabling "Require description" [$250] Category - Description hint field shows previous data after reenabling "Require description" Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

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

melvin-bot bot commented Nov 19, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@huult
Copy link
Contributor

huult commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 08:36:54 UTC.

Proposal

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

Description hint field shows previous data after reenabling "Require description"

What is the root cause of that problem?

When we toggle Require description to disable, we set commentHint to '', which is updated in Onyx to ''. That why, we can see Description hint was remove.

const updatedCommentHint = areCommentsRequired ? allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`]?.[categoryName]?.commentHint : '';

However, on the server, we do not update commentHint to ''. I say this because when we close the RHP and open it again, the OpenPolicyCategoriesPage is still able to retrieve the current value of commentHint.

  • Screenshot 2024-11-19 at 15 22 41

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

To resolve this issue, we must remove the description hint when we toggle Require description to disable, something like this:

//src/pages/workspace/categories/CategorySettingsPage.tsx#L245
         <Switch
            isOn={policyCategory?.areCommentsRequired ?? false}
            accessibilityLabel={translate('workspace.rules.categoryRules.requireDescription')}
             onToggle={(isOn) => {
                 if (policyCategory.commentHint && !isOn) {
                     Category.setWorkspaceCategoryDescriptionHint(policyID, categoryName, '');
                 }
                Category.setPolicyCategoryDescriptionRequired(policyID, categoryName, !areCommentsRequired);
            }}
        />

Test branch

POC
Screen.Recording.2024-11-19.at.15.28.19.mov

What alternative solutions did you explore? (Optional)

Or we can use areCommentsRequired to check when setting the workspace description hint

//src/pages/workspace/categories/CategorySettingsPage.tsx#L245
         <Switch
            isOn={policyCategory?.areCommentsRequired ?? false}
            accessibilityLabel={translate('workspace.rules.categoryRules.requireDescription')}
            onToggle={() => {
                 if (policyCategory.commentHint && areCommentsRequired) {
                     Category.setWorkspaceCategoryDescriptionHint(policyID, categoryName, '');
                 }
                Category.setPolicyCategoryDescriptionRequired(policyID, categoryName, !areCommentsRequired);
            }}
        />

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 19, 2024
@parasharrajat
Copy link
Member

parasharrajat commented Nov 20, 2024

I believe it is better to be fixed at backend where we just have to update the API. If we don't want to update the backend then @huult's proposal looks good to me.

🎀 👀 🎀 C reviewed

Copy link

melvin-bot bot commented Nov 20, 2024

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

Copy link

melvin-bot bot commented Nov 26, 2024

@strepanier03 @lakchote @parasharrajat 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!

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

melvin-bot bot commented Nov 26, 2024

@strepanier03, @lakchote, @parasharrajat Huh... This is 4 days overdue. Who can take care of this?

@huult

This comment was marked as outdated.

Copy link

melvin-bot bot commented Nov 26, 2024

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

@parasharrajat
Copy link
Member

Bump @lakchote

@melvin-bot melvin-bot bot removed the Overdue label Nov 26, 2024
@lakchote
Copy link
Contributor

Sorry @parasharrajat for the late answer.

I like @huult's proposal, which makes the API call to set it correctly.

@huult's proposal LGTM.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

❌ There was an error making the offer to @huult for the Contributor role. The BZ member will need to manually hire the contributor.

@lakchote
Copy link
Contributor

@strepanier03 could you please make an offer to @huult? Thanks!

@huult
Copy link
Contributor

huult commented Nov 27, 2024

Here is my Upwork profile:

https://www.upwork.com/freelancers/~0177bfe6ca1fe859f7

@huult
Copy link
Contributor

huult commented Nov 28, 2024

@parasharrajat PR is ready for review.

@huult
Copy link
Contributor

huult commented Nov 28, 2024

@strepanier03 Waiting for you to make an offer for me. Thank you!

@huult
Copy link
Contributor

huult commented Dec 2, 2024

friendly bump @strepanier03 per #52399 (comment)

@huult
Copy link
Contributor

huult commented Dec 6, 2024

@lakchote @strepanier03 I still haven’t received an offer on Upwork. Can you check it? Thank you!

@strepanier03
Copy link
Contributor

strepanier03 commented Dec 11, 2024

Just a heads up the automation for payment will make a job, or the BZ makes one when payment is due if there isn't an automatic one made.. I'll make one now since it seems like work isn't moving forward until it comes.

@strepanier03
Copy link
Contributor

Offer sent, payment is still on hold.

@huult
Copy link
Contributor

huult commented Dec 11, 2024

Thank you! I received an offer

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

This issue has not been updated in over 15 days. @strepanier03, @huult, @lakchote, @parasharrajat eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Dec 23, 2024
@parasharrajat
Copy link
Member

PR is ready for final review.

@huult
Copy link
Contributor

huult commented Dec 27, 2024

@lakchote Could you check this pull request #53249 when you have time? thank you

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

5 participants