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 - On deleting a category, full category list moves #53281

Open
3 of 8 tasks
lanitochka17 opened this issue Nov 28, 2024 · 25 comments
Open
3 of 8 tasks

[$250] Category - On deleting a category, full category list moves #53281

lanitochka17 opened this issue Nov 28, 2024 · 25 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 Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 28, 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.68-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app in both mweb and android
  2. Go to workspace settings
  3. Tap category
  4. Open last category from the list
  5. Delete the category

Expected Result:

On deleting a category, full category list must not move.

Actual Result:

On deleting a category, full category list moves in android but not in mweb.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6679383_1732819702957.az_recorder_20241129_000941.mp4
Bug6679383_1732821765430.az_recorder_20241129_005046.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864244368136739648
  • Upwork Job ID: 1864244368136739648
  • Last Price Increase: 2024-12-11
  • Automatic offers:
    • neonbhai | Contributor | 105310664
Issue OwnerCurrent Issue Owner: @getusha
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

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

@daledah
Copy link
Contributor

daledah commented Nov 28, 2024

Proposal

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

On deleting a category, full category list moves in android but not in mweb.

What is the root cause of that problem?

In some conditions, in deleteCategory, navigateBack is called before data is merged into Onyx:

const deleteCategory = () => {
Category.deleteWorkspaceCategories(policyID, [categoryName]);
setDeleteCategoryConfirmModalVisible(false);
navigateBack();
};

When navigating back, category list still hold the data before deleting, then updated with new value after onyx data is updated, which causes list move.

Similar problem appears in TagSettingsPage:

Screen.Recording.2024-11-29.at.06.44.33.mov

And possibly from Distance Rate Page, Tax page, and Report Fields page as well.

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

Wrap navigateBack inside InteractionManager.runAfterInteractions

const deleteCategory = () => {
Category.deleteWorkspaceCategories(policyID, [categoryName]);
setDeleteCategoryConfirmModalVisible(false);
navigateBack();
};

    const deleteCategory = () => {
        Category.deleteWorkspaceCategories(policyID, [categoryName]);
        setDeleteCategoryConfirmModalVisible(false);
        InteractionManager.runAfterInteractions(() => {
            navigateBack();
        });
    };

Apply the same for other pages mention in RCA.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

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.

@neonbhai
Copy link
Contributor

Proposal

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

On deleting a category, full category list moves

What is the root cause of that problem?

This happens as the navigation action runs before the Onyx update occurs:

const deleteCategory = () => {
Category.deleteWorkspaceCategories(policyID, [categoryName]);
setDeleteCategoryConfirmModalVisible(false);
navigateBack();
};

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

We will wrap the Navigation in Navigation.setNavigationActionToMicrotaskQueue to make sure it runs after the Onyx update:

const deleteCategory = () => {
    setDeleteCategoryConfirmModalVisible(false);
    Navigation.setNavigationActionToMicrotaskQueue(navigateBack);
}

We will check and fix delete behaviour in similar lists.

Result:

Before
Screen.Recording.2024-11-29.at.5.42.45.AM.mov
After
Screen.Recording.2024-11-29.at.5.45.25.AM.mov

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

Copy link

melvin-bot bot commented Dec 4, 2024

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

@JmillsExpensify
Copy link

Pretty small "bug" though I'll open it up to the community in the name of polish.

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2024
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Overdue labels Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

@melvin-bot melvin-bot bot changed the title Category - On deleting a category, full category list moves [$250] Category - On deleting a category, full category list moves Dec 4, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

@JmillsExpensify, @getusha Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Dec 10, 2024
@JmillsExpensify
Copy link

Awaiting proposal reviews.

@JmillsExpensify JmillsExpensify added Weekly KSv2 and removed Daily KSv2 labels Dec 11, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

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

@getusha
Copy link
Contributor

getusha commented Dec 12, 2024

Reviewing

@getusha
Copy link
Contributor

getusha commented Dec 12, 2024

This looks a pretty small issue but @neonbhai's proposal looks good to me if we decide to fix it.
🎀 👀 🎀 C+ Reviewed!

Copy link

melvin-bot bot commented Dec 12, 2024

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

@neonbhai
Copy link
Contributor

Thank you for assigning! Raising PR soon

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 23, 2024
Copy link

melvin-bot bot commented Dec 26, 2024

@JmillsExpensify @carlosmiceli @neonbhai @getusha this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 26, 2024
@carlosmiceli
Copy link
Contributor

@neonbhai any updates?

@carlosmiceli carlosmiceli added Daily KSv2 and removed Daily KSv2 labels Dec 26, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 26, 2024
@carlosmiceli carlosmiceli added Daily KSv2 and removed Weekly KSv2 labels Dec 26, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

@JmillsExpensify, @carlosmiceli, @neonbhai, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
@carlosmiceli
Copy link
Contributor

Same as last week, waiting for updates from @neonbhai

@carlosmiceli carlosmiceli added Daily KSv2 and removed Daily KSv2 labels Dec 30, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 30, 2024
@neonbhai
Copy link
Contributor

neonbhai commented Jan 2, 2025

Apologies for the delay here 🙇

@melvin-bot melvin-bot bot added the Overdue label Jan 2, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Jan 2, 2025
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 27, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

This issue has not been updated in over 15 days. @JmillsExpensify, @carlosmiceli, @neonbhai, @getusha 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!

@carlosmiceli
Copy link
Contributor

This is still being worked on and is awaiting a review from @getusha

@carlosmiceli carlosmiceli added Weekly KSv2 and removed Monthly KSv2 labels Jan 27, 2025
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 Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

6 participants