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

[Backwards Compatibility] [HIGH] Push all policy updates to all policy members forever #34834

Closed
17 of 19 tasks
mountiny opened this issue Jan 19, 2024 · 46 comments
Closed
17 of 19 tasks
Assignees
Labels
Daily KSv2 NewFeature Something to build that is a new item.

Comments

@mountiny
Copy link
Contributor

mountiny commented Jan 19, 2024

Problem

When the approver on Collect policy is changed, we do not update all the policy members with this information.

The submitsTo property is used to determine who to submit the report to or to compute correct NextStep information on the expense report. Hence if its not up to date after admin's changes, we can show incorrect data to the user.

Solution

When the approver is changed, push onyx update of the new accountID in the submitsTo field to all the members of a policy.

Left to do:

@mountiny mountiny added Daily KSv2 NewFeature Something to build that is a new item. Hot Pick Ready for an engineer to pick up and run with labels Jan 19, 2024
Copy link

melvin-bot bot commented Jan 19, 2024

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jan 19, 2024
@puneetlath puneetlath removed their assignment Jan 22, 2024
@flodnv flodnv self-assigned this Jan 24, 2024
@flodnv
Copy link
Contributor

flodnv commented Jan 24, 2024

I spent around 2 hours discussing what seems like a design problem in our code: https://expensify.slack.com/archives/C02MW39LT9N/p1706111344262919?thread_ts=1706104155.034209&cid=C02MW39LT9N

@iwiznia iwiznia removed the Hot Pick Ready for an engineer to pick up and run with label Jan 24, 2024
@flodnv flodnv added Daily KSv2 and removed Weekly KSv2 labels Jan 25, 2024
@flodnv
Copy link
Contributor

flodnv commented Jan 25, 2024

This is where that discussion landed:

  1. Leave the policy change logs out of this entirely. This means not touching them as part of this, and not coupling them with onyx updates.
  2. For onyx updates, I will write some code in SavePolicy that gets the policy diff and sends out all the updates to all members all the time for any change that may occur.
  3. Once that's done and deployed and working, we kill all the other code written that's coupled with policy change logs
  4. We profit, because thanks to (2) we don't ever need to think about sending out policy changes again.

@mountiny
Copy link
Contributor Author

Thanks for making this plan, it is better approach 🙌

@melvin-bot melvin-bot bot added the Overdue label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

@flodnv
Copy link
Contributor

flodnv commented Jan 29, 2024

I've been trying to wrap my ahead around how to accomplish this without introducing performance problems https://expensify.slack.com/archives/C02MW39LT9N/p1706557806120739?thread_ts=1706104155.034209&cid=C02MW39LT9N

@melvin-bot melvin-bot bot removed the Overdue label Jan 29, 2024
@greg-schroeder greg-schroeder changed the title [Wave6] Push to all policy members when approver/ submitsTo changes [HIGH] Push to all policy members when approver/ submitsTo changes Jan 31, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 1, 2024
@flodnv
Copy link
Contributor

flodnv commented Feb 2, 2024

I've been swamped with reviews this week, and working 2 days at 50% did not help. This is my top priority after https://github.com/Expensify/Expensify/issues/358326

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 2, 2024
Copy link

melvin-bot bot commented Feb 5, 2024

@flodnv Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@flodnv
Copy link
Contributor

flodnv commented Feb 5, 2024 via email

@melvin-bot melvin-bot bot removed the Overdue label Feb 5, 2024
@flodnv
Copy link
Contributor

flodnv commented Feb 5, 2024

Continued today, I have a POC where it works with the top level 'name' attribute. Tomorrow I'll work on finding a way to make it work with sub levels. I have a feeling this is going to be really challenging.

@flodnv flodnv changed the title [HIGH] Push to all policy members when approver/ submitsTo changes [HIGH] Push all policy updates to all policy members forever Feb 7, 2024
@flodnv
Copy link
Contributor

flodnv commented Feb 7, 2024

BTW, I updated the title of this issue to be more clear: Push all policy updates to all policy members forever.

More progress today:

Make it work with outputCurrency changes, which makes it work for reportFields and customUnits

More to come 🙏

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 18, 2024
@flodnv
Copy link
Contributor

flodnv commented Mar 21, 2024

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2024
@flodnv
Copy link
Contributor

flodnv commented Mar 21, 2024

2 months later, we finally get to Implement submitsTo @mountiny

From looking at it, it seems to me like we want to send submitsTo to everyone in the policy anytime approvalMode or approver changes, right??

@melvin-bot melvin-bot bot added the Overdue label Mar 25, 2024
@flodnv
Copy link
Contributor

flodnv commented Mar 25, 2024

Latest discussion on submitsTo: https://expensify.slack.com/archives/C03TQ48KC/p1711391658212239

@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@flodnv
Copy link
Contributor

flodnv commented Mar 26, 2024

Next discussion about role so I can send updates in SharePolicy: https://expensify.slack.com/archives/C03TQ48KC/p1711481616732939

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 3, 2024

Create an external issue to implement Policy::getSubmitsTo in app

This is the only important issue remaining for the Spring release. As you can see in the OP, it's being held by at least 5 other different tasks, in order to implement it the correct way. I'll be pushing these tasks so they keep going forward.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 3, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

@flodnv
Copy link
Contributor

flodnv commented Apr 8, 2024

Send updates in Policy::updateAttribute

Started brainstorming this here: https://expensify.slack.com/archives/C036QM0SLJK/p1712606285676069

@melvin-bot melvin-bot bot removed the Overdue label Apr 8, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 10, 2024

Calling Check performance done: https://github.com/Expensify/Auth/pull/9773#issuecomment-2048407381

@melvin-bot melvin-bot bot added the Overdue label Apr 15, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 15, 2024

Create an external issue to implement Policy::getSubmitsTo in app

Issues for which we are HOLDing this last item are being worked on daily.

@melvin-bot melvin-bot bot removed the Overdue label Apr 15, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 17, 2024

Created #40356

@melvin-bot melvin-bot bot added the Overdue label Apr 19, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 22, 2024

Once #40356 is closed, we can close this.

@melvin-bot melvin-bot bot removed the Overdue label Apr 22, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 22, 2024

Cleanup task for later here: https://github.com/Expensify/Expensify/issues/389638

@melvin-bot melvin-bot bot added the Overdue label Apr 24, 2024
@flodnv
Copy link
Contributor

flodnv commented Apr 25, 2024

In summary, let's close this once #40532 is in prod.

@melvin-bot melvin-bot bot removed the Overdue label Apr 25, 2024
@trjExpensify
Copy link
Contributor

Sounds good to me! Deployed to prod, closing. Solid work here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 NewFeature Something to build that is a new item.
Projects
No open projects
Development

No branches or pull requests

5 participants