9745 - Large Case Support (amgen 5,000 exhibits)#9765
Open
codyseibert wants to merge 33 commits intostagingfrom
Open
9745 - Large Case Support (amgen 5,000 exhibits)#9765codyseibert wants to merge 33 commits intostagingfrom
codyseibert wants to merge 33 commits intostagingfrom
Conversation
… payload too large issues
…/ef-cms into 9745-amgen-large-case-support
…/ef-cms into 9745-amgen-large-case-support
…/ef-cms into 9745-amgen-large-case-support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces change that reduce the amount of information returned from these interactors due to the 6mb limit. For the Amgen case, they plan to have 5,000+ exhibits which means all of our backend endpoints which used to return the fully updated case (including all docket entries), would return a ton of data which would cause it to hit limits. In order to get this case working in our system, it required some of the following optimizations:
Fetch Docket Entries Separate
We added a new endpoint which allows the UI to fetch all the docket entries, 1,000 at a time, from the backend. This means that in our UI, whenever we need to fetch the full case, we first fetch the case metadata using the ?excludeDocketEntries=true query string, then we fetch the docket entries as separate paginated rest requests. The getCaseInteractor proxy will then re-construct the full case on the UI meaning the UI requires minimal changes
Updating Cases
All throughout our code base when we want to update a something simple on a case, we invoke updateCaseAndAssociations which will fetch the entire case and all the docket entries once more. Often these interactors already fetch the full case up front and then modify it, then it'll call updateCaseAndAssociations which will fetch the full case again and do a diff. The optimization in this pull request allows passing an oldCase to updateCaseAndAssocations which causes that helper function to not need to re-fetch the full case. This removes double fetching of the full case which for amgen is a huge savings. The cavet is you much remember to do a structuredClone to create this oldCase object so that you do not pass it around and update it by reference somewhere in the code.
Return Docket Number
In a lot of these endpoints, after we modify a case, we return the full case and all the docket entires associated with it back in the API request payload. This again causes the app to crash as the data for amgen is too large. Often we never need to send back the full case. Instead, we can just send back a simple payload and the UI can refetch the full case if it needs to. This required changing a lot of code but will cause a lot less data to need to be serialized and send back in the response bodys when doing POST or PUT or PATCH calls. Eventually I'd like to have all these endpoints just return a 204 no content, but for now we just return the bare minimum when possible.