Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.43k stars 2.8k forks source link

HIGH: [Tracking] Implement report NextSteps in Auth #42118

Open mountiny opened 4 months ago

mountiny commented 4 months ago

Whatsnext post here.

Design doc https://docs.google.com/document/d/1gUDVqDdDj0jVOIuFBqPr0D6-vnClB-iztl38PzsiBqE/edit

GH Project https://github.com/orgs/Expensify/projects/154/views/1 CAP issue https://github.com/Expensify/Expensify/issues/406189

Proposal Migrate the report next steps from PHP to Auth

Problem Report next steps are currently calculated on the fly in PHP and are not stored in a database. This means that any commands using report next steps cannot be implemented following the true 1:1:1 API philosophy at the moment. We cannot queue report next steps updates in Auth because we must wait for an Auth command response to trigger the calculation of updated next steps in PHP. Only then can the update be pushed to relevant clients.

Similar to the case of violations, this leads to multiple Auth calls being made during a single API request, breaking the 1:1:1 rule. Many commands are slowed down due to the report next steps computation triggering multiple Auth calls. For example, any action that changes the state or status of a report will trigger a new next step computation. These may be computed multiple times per report as each participant of the expense report might receive different next steps.

It's worth noting that in order to support optimistic and offline calculation of some report next steps, we've implemented the core collect workspace next steps logic in the front-end code of NewDot.

While this project should only focus on migrating what we have from PHP to Auth, it is important to note that this migration is likely to be critical for ensuring that important upcoming projects are 1:1:1-compliant, such as the Search page, where we need to compute the next action for a report efficiently.

Solution At a high level, the solution is to move report next steps to Auth; however, the details need to be fleshed out through predesign and a design document.

At minimum, we should discuss:

cc @JmillsExpensify @cead22


Tasks

Issue OwnerCurrent Issue Owner: @dangrous
mountiny commented 4 months ago

Shared in WN https://expensify.slack.com/archives/CC7NECV4L/p1715644599860159

muttmuure commented 4 months ago

Moving this to critical to include it in the daily updates

mountiny commented 4 months ago

The proposal got enough support so we can move ahead. I will plan to make a short predesign for this project, but my week is broken up with moving stuff from Scotland to Czechia and short planned holiday. I expect to make more progress next week, but I will attempt to have the predesign out by EOW, early next week the latest.

melvin-bot[bot] commented 4 months ago

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

mountiny commented 4 months ago

Gonna pick this back up this week once the performance is in better place

mountiny commented 4 months ago

Looking into a predesign for tomorrow

mountiny commented 4 months ago

Deployer duties took over, still on my list

mountiny commented 4 months ago

The predesign was posted on Friday, going to sum it up to the doc this week

mountiny commented 4 months ago

Aiming for EOW still

mountiny commented 4 months ago

Violations doc is out, I havent made much progress yet on this, but will ship this on Monday

melvin-bot[bot] commented 4 months ago

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

mountiny commented 4 months ago

Working on the high level still, aiming to have it mostly ready today

mountiny commented 4 months ago

Sent the design doc for high-level review

melvin-bot[bot] commented 4 months ago

:wave: Hello Generalist Track Team - you have been assigned to review this High Level Design Doc. Check out this Stack Overflow for some tips on reviewing a design doc. Once you are done, simply press the Add "Reviewed Doc" comment button in the right hand side K2 panel or follow these instructions.


dannymcclain commented 4 months ago

I have read and reviewed this Design Doc!

abekkala commented 4 months ago

I have read and reviewed this Design Doc!

marcaaron commented 4 months ago

I have read and reviewed this Design Doc!

Gonals commented 4 months ago

I have read and reviewed this Design Doc!

slafortune commented 4 months ago

I have read and reviewed this Design Doc!

danielrvidal commented 4 months ago

I have read and reviewed this Design Doc!

mountiny commented 4 months ago

Reviews trickling in

MitchExpensify commented 4 months ago

I have read and reviewed this Design Doc!

davidcardoza commented 4 months ago

I have read and reviewed this Design Doc!

mountiny commented 3 months ago

reviews still coming in

coleaeason commented 3 months ago

I have read and reviewed this Design Doc!

AndrewGable commented 3 months ago

I have read and reviewed this Design Doc!

puneetlath commented 3 months ago

I have read and reviewed this Design Doc!

twisterdotcom commented 3 months ago

I have read and reviewed this Design Doc!

mountiny commented 3 months ago

Working through the comments and I will work on the detailed section

iwiznia commented 3 months ago

I have read and reviewed this Design Doc!

francoisl commented 3 months ago

I have read and reviewed this Design Doc!

melvin-bot[bot] commented 3 months ago

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

mountiny commented 3 months ago

Nailing down the last remaining things in #fast-apis from the high level comments before heading to the detailed section.

mountiny commented 3 months ago

We are mostly agreeing on the threads now. We want to make sure we can send the same update/ text to everyone (so we can use pusher report channel), and keep the reporti the next steps inside the report object with nextSteps.

There is a project that should ideally come before this in implementation https://docs.google.com/document/d/1mUUQzep18IWdZpwG6Qqtw9JH0dvLMvLXh-KTn_B51I4/edit we are simplifying the next steps/ doing audit and as part of that we are focusing on updating the copy so the same message can be shown to every participant of the report such that is makes sense who needs to do what.

We are going to get that ready to review by Monday

heyjennahay commented 3 months ago

I have read and reviewed this Design Doc!

mountiny commented 3 months ago

Update:

mountiny commented 3 months ago

Same as above, getting through the audit

melvin-bot[bot] commented 3 months ago

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

mountiny commented 3 months ago

Working on updating the next steps based on the audit project. Also going to loop in another engineer for help with this project

mountiny commented 2 months ago

Still proceeding with the next steps audit, @dangrous is going to take over this migration detailed doc and implementation

melvin-bot[bot] commented 2 months ago

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

mountiny commented 2 months ago

@dangrous is joining the team, we are getting through the copy update for now, midway implementation there

dangrous commented 2 months ago

Working on the PRs! There's a bit of clarification needed but comments are left in the doc, we should be able to keep moving shortly. We may also need one additional cleanup PR at the end, both to fix some edge cases but also to DRY up and simplify the code that touches all cases, once everything's simplified!

melvin-bot[bot] commented 2 months ago

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

mountiny commented 2 months ago

Getting through the report audit and then we can move ahead with the migration

dangrous commented 2 months ago

Almost done with the simplification/audit, then can move forward with this

dangrous commented 2 months ago

Nearly done! Should be ready to move forward with the detailed design next week

dangrous commented 2 months ago

I believe all PRs for the simplification are now merged! Will be able to continue work on the migration details this week in hopes of getting it ready to go for once violations are migrated. I'll have a better ETA on the details once I start working on that - right now focusing on finishing up the Copilot design doc

dangrous commented 2 months ago

Finishing up some minor changes to copy - https://github.com/Expensify/Web-Expensify/pull/42950

dangrous commented 2 months ago

Not overdue, the simplification is just waiting on new tests, and then we can start shifting attention to this. We're also still waiting for the violations migration so I may switch this to Weekly for a little bit, since the pressure is a bit off. Let me know if you disagree!