-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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-05-22] [$250] Categories - Unable to go to other tabs after enabling " must categorize all spend" offline #41325
Comments
Triggered auto assignment to @joekaufmanexpensify ( |
We think that this bug might be related to #wave-collect - Release 1 |
@joekaufmanexpensify 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. |
It doesn't only happen when you're offline. If you create a new workspace while online and enable this feature, it precludes accessing tabs in the workspace editor. Definitely a bug. 2024-04-30_12-39-00.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~014991e62b8f3dcfbf |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Categories - Unable to go to other tabs after enabling " must categorize all spend" offline What is the root cause of that problem?Policy.errors will always be true instead we should check if it's an empty object
Enabling categories will make both of the above conditions true, which will result in all options being disabled.
What changes do you think we should make in order to solve the problem?Instead of policy.error we should check for !isEmptyObject(policy.errors)
Warning I don't think we should use errors: null. If the policy had previous errors, enabling categories will reset all errors to null. What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?Optimistic data and success data is setting errors to an object with App/src/libs/actions/Policy.ts Lines 3571 to 3599 in 942c851
For tags, same issue is there using App/src/libs/actions/Policy.ts Lines 4355 to 4381 in 942c851
This leads to What changes do you think we should make in order to solve the problem?In the optimistic data, errors should be set to null for categories and tags. function setWorkspaceRequiresCategory(policyID: string, requiresCategory: boolean) {
const onyxData: OnyxData = {
optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
requiresCategory,
- errors: {
- requiresCategory: null,
- },
+ errors: null,
pendingFields: {
requiresCategory: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
],
successData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
- errors: {
- requiresCategory: null,
- },
+ errors: null,
pendingFields: {
requiresCategory: null,
},
},
},
],
failureData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
requiresCategory: !requiresCategory,
errors: ErrorUtils.getMicroSecondOnyxError('workspace.categories.updateFailureMessage'),
pendingFields: {
requiresCategory: null,
},
},
},
],
};
const parameters = {
policyID,
requiresCategory,
};
API.write(WRITE_COMMANDS.SET_WORKSPACE_REQUIRES_CATEGORY, parameters, onyxData);
} The method for tags Same change is needed for tags. We should also update the check in |
Hi, @joekaufmanexpensify, I'll be OOO for the next two weeks. Could you please reassign another c+? :) |
Will do! |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 ( |
♻️ Reviewing proposals. |
@Nodebrute's proposal looks good to me! They were first to identify the root cause and propose the I agree with the note that we shouldn't set 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @chiragsalian, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@ShridharGoel Given that the first proposal identified the RCA and proposed the If I'm missing anything please let me know and if the argument for your version of the solution is solid then I'll reconsider assignment. |
@chiragsalian Waiting to be assigned. |
📣 @ikevin127 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR on staging |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.73-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-05-22. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
@ikevin127 please handle BZ checklist so we can issue payment this week |
No need to start a discussion as the logic that introduced this issue was written in 2022 back when we were using React class components and plain javascript. Since then we migrated to React functional components and typescript which means that this kind of faulty logic is less likely to be written.
Regression Test Proposal
Do we agree 👍 or 👎. |
Checklist all set. |
All set to issue payment! We need to pay:
|
@Nodebrute $250 sent and contract ended! |
@ikevin127 $250 sent and contract ended! |
Upwork job closed. |
All set, thanks everyone! |
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.68-0
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
User should be able to navigate to other tabs after toggling on "Members must categorize all spend" offline.
Actual Result:
User is blocked from clicking on other tabs after toggling on "Members must categorize all spend" offline.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6466535_1714480419141.20240430_202756.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @joekaufmanexpensifyThe text was updated successfully, but these errors were encountered: