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

[HOLD for payment 2024-06-13] [HOLD for payment 2024-06-11] [$250] Tags - Console error when disabling tag when created offline on web, app crashes on iOS #42885

Closed
6 tasks done
kavimuru opened this issue May 31, 2024 · 51 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 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented May 31, 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.78-2
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: exp around https://expensify.testrail.io/index.php?/tests/view/4587396&group_by=cases:section_id&group_order=asc&group_id=296081
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:

  1. Go to staging.new.expensify.com
  2. Go offline.
  3. Create a new workspace.
  4. Go to workspace settings > More features.
  5. Enable Tags.
  6. Go to Tags.
  7. Add a tag.
  8. Click on the tag.
  9. Disable the tag.

Expected Result:

Tag can be disabled.

Actual Result:

Tag cannot disabled. Console error shows up on web. App crashes on iOS.

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

Bug6496889_1717113061649.crash_iOS.mp4
Bug6496889_1717113061645.tag_offline.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01788b9ab12b2eb04a
  • Upwork Job ID: 1797634804417064960
  • Last Price Increase: 2024-06-03
  • Automatic offers:
    • GandalfGwaihir | Contributor | 102575766
    • tienifr | Contributor | 102577178
Issue OwnerCurrent Issue Owner: @bfitzexpensify
@kavimuru kavimuru added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels May 31, 2024
Copy link

melvin-bot bot commented May 31, 2024

Triggered auto assignment to @bfitzexpensify (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 May 31, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 31, 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.

@kavimuru
Copy link
Author

@bfitzexpensify 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

@kavimuru
Copy link
Author

We think this bug might be related to #wave-collect - Release 1

@Nodebrute
Copy link
Contributor

Nodebrute commented May 31, 2024

Proposal

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

Console error when disabling tag when created offline on web, app crashes on iOS

What is the root cause of that problem?

When we enable tags offline, PolicyTag.orderWeight will be undefined because this data is returned by the backend. Passing this undefined value will cause a console error to appear

setWorkspaceTagEnabled(route.params.policyID, {[currentPolicyTag.name]: {name: currentPolicyTag.name, enabled: value}}, policyTag.orderWeight);

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

Instead of using PolicyTag.orderWeight we can use route.params.orderWeight here

setWorkspaceTagEnabled(route.params.policyID, {[currentPolicyTag.name]: {name: currentPolicyTag.name, enabled: value}}, policyTag.orderWeight);

Just like we are using in WorkspaceViewTagsPage.tsx

Tag.setWorkspaceTagEnabled(policyID, tagsToDisable, route.params.orderWeight);

We can also do it like this policyTag.orderWeight ?? route.params.orderWeight
Let's check other places where we have this issue and fix it

What alternative solutions did you explore? (Optional)

We can optimistically set this orderWeight. Or we can use 0

Tag.setWorkspaceTagEnabled(policyID, tagsToDisable, 0);

@melvin-bot melvin-bot bot added the Overdue label Jun 3, 2024
@tienifr
Copy link
Contributor

tienifr commented Jun 3, 2024

Proposal

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

Tag cannot disabled. Console error shows up on web. App crashes on iOS.

What is the root cause of that problem?

  • In online mode:
  1. Create new workspace.
  2. Enable tags feature.
  3. Go to tags page. In here, API read OpenPolicyTagsPage is called, which will return policyTags_${policyID}:
{
    "Tag": {
        "name": "Tag",
        "orderWeight": 0,
        "required": false,
        "tags": []
    }
}
  • In offline mode:
  1. Create new workspace.
  2. Enable tags feature.
  3. Go to tags page. In here, there is no read API is called, so now the policyTags_${policyID} is still undefined.
  4. Create a new tag. In here, policyTag is {}, so we create a optimistic data like:
{
    "undefined": {
        "tags": {
            "test": {
                "name": "test",
                "enabled": true,
                "errors": null,
                "pendingAction": "add"
            }
        }
    }
}
  1. Then, if we try to disable the above created tag, in here, the policyTag is {} as well, the leads to the error "TypeError: Cannot read properties of undefined (reading 'test')"

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

  • We can add the optimistic data
{
    "Tag": {
        "name": "Tag",
        "orderWeight": 0,
        "required": false,
        "tags": []
    }
}

to policyTags_${policyID} when calling API OpenPolicyTagsPage or EnablePolicyTags. And we just apply this optimistic data if policyTags_${policyID} is empty.

  • And then in here, we can early return if policyTags_${policyID} is empty to reduce similar bugs in future.

What alternative solutions did you explore? (Optional)

  • We can prevent user from creating a new tag if policyTags_${policyID} is empty.
  • To do it, we can disable the Save button on new tag page if policyTags_${policyID} is empty.
  • Or we can display not found page or FullPageOfflineBlockingView on new tag page if policyTags_${policyID} is empty in offline mode, and display the loading indicator if policyTags_${policyID} is empty in online mode.

@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Jun 3, 2024
@melvin-bot melvin-bot bot changed the title Tags - Console error when disabling tag when created offline on web, app crashes on iOS [$250] Tags - Console error when disabling tag when created offline on web, app crashes on iOS Jun 3, 2024
Copy link

melvin-bot bot commented Jun 3, 2024

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

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

melvin-bot bot commented Jun 3, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 3, 2024
@Gonals Gonals assigned allgandalf and unassigned akinwale Jun 3, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 3, 2024
Copy link

melvin-bot bot commented Jun 3, 2024

📣 @GandalfGwaihir 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@allgandalf
Copy link
Contributor

Reviewing Proposals Now! 🟢

@allgandalf
Copy link
Contributor

allgandalf commented Jun 4, 2024

False alarm, contributors were discussing something different and linked this issue :)

#43042 (comment)

@hayata-suenaga
Copy link
Contributor

payment summary -> #42885 (comment)

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 6, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-11] [$250] Tags - Console error when disabling tag when created offline on web, app crashes on iOS [HOLD for payment 2024-06-13] [HOLD for payment 2024-06-11] [$250] Tags - Console error when disabling tag when created offline on web, app crashes on iOS Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-11 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-06-13. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 6, 2024

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:

  • [@allgandalf] The PR that introduced the bug has been identified. Link to the PR:
  • [@allgandalf] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@allgandalf] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@allgandalf] Determine if we should create a regression test for this bug.
  • [@allgandalf] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 10, 2024
@sakluger
Copy link
Contributor

Hey @hayata-suenaga or @allgandalf, could you please confirm if this is a regression from #42314? If so, I'll need to adjust the payment for that bug accordingly.

@allgandalf
Copy link
Contributor

hey @sakluger , please refer to payment summary from @mountiny here

@sakluger
Copy link
Contributor

Hey @allgandalf, @mountiny's commentdoesn't totally answer my question. I'm asking if this is a regression of #42314 because I need to know if it will affect payment of that other issue.

@mountiny
Copy link
Contributor

@sakluger yes it was a regression from #42315

@sakluger
Copy link
Contributor

@mountiny thanks! I'll adjust the payout accordingly.

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

@Gonals, @mountiny, @bfitzexpensify, @allgandalf, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@bfitzexpensify
Copy link
Contributor

Payments complete.

@allgandalf, please complete the BZ checklist - thank you!

@melvin-bot melvin-bot bot removed the Overdue label Jun 14, 2024
@allgandalf
Copy link
Contributor

@bfitzexpensify , Another PR fixed this issue (Also i was not the C+ on that PR), do we still need a checklist here? LMK if yes, will provide over here :) thanks

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 17, 2024

@Gonals, @mountiny, @bfitzexpensify, @allgandalf, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@bfitzexpensify
Copy link
Contributor

@allgandalf no then, we are all good. Closing this out.

@Nodebrute
Copy link
Contributor

@bfitzexpensify I haven't received payment as per this comment

@bfitzexpensify
Copy link
Contributor

@Nodebrute @allgandalf can you please share your Upwork profile links?

@Nodebrute
Copy link
Contributor

@bfitzexpensify https://www.upwork.com/freelancers/~01ba6c9fa6796a82f4

@bfitzexpensify
Copy link
Contributor

All paid out here, closing this out

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests