Proper rate limit error codes in websockets #312
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts#312
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: If a mint declines a websocket protocol upgrade request (for example because the client is already rate limited - HTTP 429), JavaScript implementations will not hand that HTTP error back to the client. Instead JS will throw an error just like it would for general networking issues. There is no way to differentiate between the two.
This is an issue, because clients would usually want to try some re-connection logic on network errors, but on rate limit errors this is exactly what not to do.
I think we should extend the websocket nut: If a mint wants to decline an incoming websocket connection it SHOULD NOT decline the upgrade request. Instead a mint SHOULD always open the connection, then send an error frame through the opened connection and close immediately after.