Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Validate user input #3

Closed
dgarciabriseno opened this issue Sep 8, 2022 · 0 comments · Fixed by #11
Closed

Validate user input #3

dgarciabriseno opened this issue Sep 8, 2022 · 0 comments · Fixed by #11

Comments

@dgarciabriseno
Copy link
Collaborator

It's possible that the user sets cadence really low i.e. 1 second and the date range very high, such as 1 year.

This would result in roughly 31,540,000 requests to construct all the textures needed to create this scene. This is too much and should not be allowed. (Maybe it can be allowed when #2 is implemented, but probably still no.)

We should validate the input and not allow any query that we expect to return more than some arbitrary amount of frames that we set in the configuration.

For now, default this to 60, since there are 3 API queries per frame, this already results in 180 API requests. We can increase this limit when #2 is implemented.

The algorithm is:

  1. Get the current cadence.
  2. Count how many cadences exist between the start and end range
  3. If this number is greater than the amount set in the configuration, then fail the request and alert the user.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant