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

notify user if rate limit hit #1206

Open
huss opened this issue Apr 6, 2024 · 4 comments
Open

notify user if rate limit hit #1206

huss opened this issue Apr 6, 2024 · 4 comments
Assignees
Labels
p-low-priority t-enhancement This issues tracks a potential improvement to the software
Milestone

Comments

@huss
Copy link
Member

huss commented Apr 6, 2024

Is your feature request related to a problem? Please describe.

src/server/app.js has limits on the rate of certain types of requests but the OED user is not notified when the request fails for this reason.

Describe the solution you'd like

It would be nice to notify user if limit is hit and maybe to retry after a given delay. Care should be taken that the retry does not enter a bad loop as many are retried.

Describe alternatives you've considered

Leave as is

Additional context

Normally the rate limit is only hit by malicious use or coding/scripting errors. Thus, OED does not expect the limit to be hit (may happen rarely) for regular usage. Normally a retry would fix this.

@huss huss added t-enhancement This issues tracks a potential improvement to the software p-low-priority labels Apr 6, 2024
@huss huss added this to the 1.x milestone Apr 6, 2024
@huss
Copy link
Member Author

huss commented May 31, 2024

https://express-rate-limit.mintlify.app/reference/configuration has a message that should be sent back when the limit is hit. It may already be sent and it is a matter of displaying it in some way.

@huss
Copy link
Member Author

huss commented Sep 9, 2024

The rate limiting code is mostly in src/server/app.js.

@zhenga5
Copy link
Contributor

zhenga5 commented Sep 27, 2024

Can I work on this issue.

@huss huss modified the milestones: 2.x, 2.0 release Oct 18, 2024
@zhenga5
Copy link
Contributor

zhenga5 commented Nov 8, 2024

PR #1370 added messages when you hit the rate limit but doesn't always display.
This fix only applies to cases where the user hits a limit on the main page but not a subroute.

https://github.com/OpenEnergyDashboard/OED/blob/development/src/server/app.js
I attempted to fix this by applying the general rate limiter to all the subroutes and looking in the console for any rate limit errors but this only made more rate limit errors.

This issue is still open and requires more work to fix notifying the user when hitting the rate limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-low-priority t-enhancement This issues tracks a potential improvement to the software
Projects
None yet
Development

No branches or pull requests

2 participants