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

Add assignment load limit #9

Merged
merged 4 commits into from
Mar 8, 2024
Merged

Add assignment load limit #9

merged 4 commits into from
Mar 8, 2024

Conversation

crayolakat
Copy link

@crayolakat crayolakat commented Jan 31, 2024

Description

There are time and bandwidth limitations on API calls and their responses when Spoke is deployed on AWS Lambda. This can cause an indefinite 504 error on the TexterTodo page If a texter is assigned a lot of contacts (~>=50,000).

This PR adds an ASSIGNMENT_LOAD_LIMIT variable to limit the number of contacts fetched by the getContacts(...) API call at one time.

Checklist:

  • I have manually tested my changes on desktop and mobile
  • The test suite passes locally with my changes
  • If my change is a UI change, I have attached a screenshot to the description section of this pull request
  • My change is 300 lines of code or less, or has a documented reason in the description why it’s longer
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • My PR is labeled [WIP] if it is in progress

Copy link

@ibrand ibrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did a talking PR for this, and agreed that Kathy could add a test to the PR. I'll approve once the test is in!

Copy link

sonarcloud bot commented Mar 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@crayolakat
Copy link
Author

@ibrand Added Jest tests to verify SQL queries when ASSIGNMENT_LOAD_LIMIT is set and not set. Added ASSIGMENT_LOAD_LIMIT=1 to dev-tools/.env.test to demonstrate in Cypress end-to-end campaign test that all assignments are contacted even if ASSIGNMENT_LOAD_LIMIT is less than the # of assignments a texter has (texter has 2 assignments in the Cypress test).

@crayolakat crayolakat requested a review from ibrand March 6, 2024 22:06
@ibrand ibrand requested a review from codygordon March 7, 2024 21:00
@crayolakat crayolakat merged commit de558ff into main Mar 8, 2024
14 checks passed
@crayolakat crayolakat deleted the kathy-fix-504-bulk branch March 8, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants