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

[AWAITING PAYMENT] [$250] [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name #48879

Closed
6 tasks done
IuliiaHerets opened this issue Sep 10, 2024 · 21 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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 10, 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: 9.0.31-12
Reproducible in staging?: Y
Reproducible in production?: N/A
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch New Expensify app.
  2. Create a new workspace.
  3. Go to Workspace settings > Rules.
  4. Enable Custom report names.
  5. Tap Custom name.
  6. Clear the field, enter anything and save it.
  7. Try to scroll through the app.

Expected Result:

App will be responsive after updating Custom report name.

Actual Result:

App is freezing after updating Custom report name.
On web, app is responsive, but "Custom report names" and "Prevent members from changing custom report names toggles" are no longer working after updating Custom report name.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6598298_1725943845774.web.1.mp4
Bug6598298_1725943845758.Android.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843814682618579436
  • Upwork Job ID: 1843814682618579436
  • Last Price Increase: 2024-10-09
Issue OwnerCurrent Issue Owner: @
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 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.

Copy link

melvin-bot bot commented Sep 10, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 10, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 10, 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.

@Nodebrute
Copy link
Contributor

Proposal

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

App freezes atter updating Custom report name

What is the root cause of that problem?

This error will only occur when we change the custom report names and areReportFieldsEnabled are false. When we call setPolicyDefaultReportTitle for the first time it's response also returns areReportFieldsEnabled:true which will cause the following condition to be true and in return this useEffect will run in loop causing the app to freeze on different devics

highlighted={enabledItem?.routeName === item.routeName}

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

We can disable custom report names and tell user to go to more features and enable reportFields. We use this approach widely in our app
Screenshot 2024-09-10 at 6 59 02 PM

 title: translate('workspace.rules.expenseReportRules.customReportNamesTitle'),
            subtitle: policy?.areReportFieldsEnabled ? translate('workspace.rules.expenseReportRules.customReportNamesSubtitle') : renderFallbackSubtitle(translate('common.approvals').toLowerCase()),
            switchAccessibilityLabel: translate('workspace.rules.expenseReportRules.customReportNamesTitle'),
            isActive: policy?.shouldShowCustomReportTitleOption && policy?.areReportFieldsEnabled,
            disabled: !policy?.areReportFieldsEnabled,
            pendingAction: policy?.pendingFields?.shouldShowCustomReportTitleOption,

Note

This is just a pseudo-code example; other minor details can be addressed in the PR. We may also need to update the fallback subtitle content, so a revised version of that will be required.

What alternative solutions did you explore? (Optional)

We can optimistically set areReportFieldsEnabled to true if report fields are not enabled.

Solution 3
We can check here if !policy?.areReportFieldsEnabled then we can call Policy.enablePolicyReportFields. We can do something like this

  onSubmit={({customName}) => {
                        if( !policy?.areReportFieldsEnabled){
                            Policy.enablePolicyReportFields(policyID, true, true)
                        }
                        PolicyActions.setPolicyDefaultReportTitle(policyID, customName);
                        Navigation.setNavigationActionToMicrotaskQueue(Navigation.goBack);
                    }}

@lakchote
Copy link
Contributor

lakchote commented Sep 10, 2024

Not a blocker, it's behing beta BETA_WORKSPACE_RULES

cc @BrtqKr @marcaaron since you've worked on [OldDot Rules Migration] Expense report rules

@lakchote lakchote added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 10, 2024
@BrtqKr
Copy link
Contributor

BrtqKr commented Sep 10, 2024

@lakchote I've got a draft for that, but I think we should slightly adjust the logic. If someone disables the report fields, I'd probably assume that the custom names would be switched off and the nested values would be removed. If we end up agreeing on that solution, this will probably require back-end changes, right?

Those fields would be

policy.shouldShowCustomReportTitleOption
policy?.fieldList?.[text_title].defaultValue
policy?.fieldList?.[text_title].deletable

and apart from that front-end changes in the actions to handle optimistic updates properly

@Nodebrute
Copy link
Contributor

@lakchote Since my proposal was used to create the solution and finding the root cause was very challenging, could you let me know if there will be any compensation for this contribution?

@marcaaron
Copy link
Contributor

If someone disables the report fields, I'd probably assume that the custom names would be switched off and the nested values would be removed

Yes I think that was missed in the implementation, but was included in the design:

If the user disables this option (i.e. sends enable: false) from NewDot that will reset the formula back to {report:type} {report:startdate} which we can do by modifying the policy by calling PolicyAPI::mergeReportFields() after setting shouldShowCustomReportTitleOption: false on the policy object.

I can raise a PR to get this fixed. But in the meantime I think it's also fine to not reset anything.

@marcaaron marcaaron assigned marcaaron and unassigned lakchote Sep 10, 2024
@marcaaron marcaaron added the Internal Requires API changes or must be handled by Expensify staff label Sep 10, 2024
@marcaaron
Copy link
Contributor

Just a heads up that this is going to take several days or more to prepare backend changes due to it triggering a required refactor so we should proceed with a front end solution for now.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 11, 2024
@BrtqKr
Copy link
Contributor

BrtqKr commented Sep 11, 2024

@marcaaron, ok then let's just do it separately #48908

@lakchote
Copy link
Contributor

@lakchote Since my proposal was used to create the solution and finding the root cause was very challenging, could you let me know if there will be any compensation for this contribution?

First of all, thank you for suggesting a proposal to solve this.
However we weren't seeking for external help on this one (no External label was present) and your solution isn't the one we're going to pursue as we'll need to do some backend changes. Hope you understand!

@marcaaron marcaaron changed the title Rules - App freezes atter updating Custom report name [OldDot Rules Migration] [Polish] - App freezes atter updating Custom report name Sep 11, 2024
@marcaaron marcaaron changed the title [OldDot Rules Migration] [Polish] - App freezes atter updating Custom report name [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name Sep 11, 2024
@marcaaron
Copy link
Contributor

First part of the BE fix in Auth is done. Second half is in review.

@marcaaron
Copy link
Contributor

Backend changes are done and deployed so we should be good to close this one out.

However, @shubham1206agra is maybe still requiring payment for their review of this PR.

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Oct 9, 2024
@melvin-bot melvin-bot bot changed the title [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name [$250] [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name Oct 9, 2024
Copy link

melvin-bot bot commented Oct 9, 2024

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

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

melvin-bot bot commented Oct 9, 2024

Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new.

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

@shubham1206agra you get paid for this anywhere else?

@garrettmknight garrettmknight removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 9, 2024
@garrettmknight garrettmknight changed the title [$250] [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name [AWAITING PAYMENT] [$250] [OldDot Rules Migration] [Polish] - App freezes after updating Custom report name Oct 9, 2024
@shubham1206agra
Copy link
Contributor

No

@garrettmknight
Copy link
Contributor

Cool - offer is out to you. https://www.upwork.com/nx/wm/offer/104378678

@garrettmknight garrettmknight added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Oct 11, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 14, 2024
@garrettmknight
Copy link
Contributor

@shubham1206agra can you accept the offer when you get a chance?

@melvin-bot melvin-bot bot removed the Overdue label Oct 15, 2024
@shubham1206agra
Copy link
Contributor

@garrettmknight Offer accepted

@garrettmknight
Copy link
Contributor

Paid, closing

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 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
Status: Done
Development

No branches or pull requests

7 participants