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

Handle ratelimiting #42

Open
strugee opened this issue Nov 17, 2023 · 2 comments
Open

Handle ratelimiting #42

strugee opened this issue Nov 17, 2023 · 2 comments

Comments

@strugee
Copy link
Member

strugee commented Nov 17, 2023

We don't seem to do this properly. Snippet from my local logs against my homeserver:

2023-11-16T20:43:26.875-08:00 πŸ—„οΈ Get state { room: 'SeaGL2023-Volunteering', type: 'org.seagl.patch.redirect', key: undefined }
2023-11-16T20:43:26.876-08:00 🏘️ Add to space { space: 'SeaGL2023-Information', child: 'SeaGL2023-InfoBooth' }
Rate limited: {"ms":4855}
2023-11-16T20:43:31.943-08:00 🏘️ Add to space { space: 'SeaGL2023-Information', child: 'SeaGL2023-BotHelp' }
Rate limited: {"ms":4768}
2023-11-16T20:43:37.024-08:00 🏘️ Add to space { space: 'SeaGL2023-Information', child: 'SeaGL2023-SpeakerHelp' }
Rate limited: {"ms":4697}
2023-11-16T20:43:42.041-08:00 🏘️ Add to space { space: 'SeaGL2023-Information', child: 'SeaGL2023-SponsorHelp' }
Rate limited: {"ms":4682}
2023-11-16T20:43:47.062-08:00 🏘️ Add to space { space: 'SeaGL2023-Information', child: 'SeaGL2023-Volunteering' }
Rate limited: {"ms":4667}
2023-11-16T20:43:51.952-08:00 πŸ”– Resolve tag { tag: 'seagl2023-restricted' }
@altsalt
Copy link
Member

altsalt commented Nov 17, 2023

I think this is being handled and those messages are just notices, but I could be wrong.

@strugee
Copy link
Member Author

strugee commented Nov 17, 2023

I think we're both wrong, actually.

Last night I misread the preceding line and thought that it was continually trying things against the space. But the rooms are different in each message. So I think you're right that it is being handled. However, notice how the counter is decreasing for each attempt - that indicates to me that there's one rate limit being applied to all of these requests, but we don't back off new requests until we've received a rate limit response back. Instead once we get one rate limit response, that should cause all subsequent requests to be deferred until the ratelimit window has passed.

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

No branches or pull requests

2 participants