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

Search control fails silently on 429 (Too Many Requests) #1999

Open
MattiasSp opened this issue Apr 22, 2024 · 3 comments
Open

Search control fails silently on 429 (Too Many Requests) #1999

MattiasSp opened this issue Apr 22, 2024 · 3 comments

Comments

@MattiasSp
Copy link
Contributor

Description
When making too many requests to a search endpoint (such as Origo Server after origo-map/origo-server@580f9b8) the client can recieve a 429 - Too Many Requests - response. The search control does not give the user any useful feedback in these cases, failing silently instead.

To Reproduce
Steps to reproduce the behavior:

  1. Make more than 100 requests to an Origo Server endpoint within the 15 minute window using the Search control.
  2. See the client give no reaction at all, while logging the 429 error and VM2401:1 Uncaught (in promise) SyntaxError: Unexpected token 'T', "Too many r"... is not valid JSON to the console.

Expected behavior
A discrete visual feedback about the cause of the error, perhaps even with info about "try again in X seconds".

@MattiasSp
Copy link
Contributor Author

If this is something that could/should be solved by a toaster message, would it make sense to make the toaster function in infowindow_exporthandler.js into a more generalized utility function and reuse that?

@johnnyblasta
Copy link
Collaborator

The limit should be raised in origo-server, but that doesn't solve if the new limit is reached.

@MattiasSp
Copy link
Contributor Author

MattiasSp commented Apr 22, 2024

I found the discussion in #1982 and could just add this issue as another occasion where a general purpose toaster would be useful :)

The fix for this would be very easy to implement if #1990 gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants