-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add call retry option to retry calls which fail due to connection error #7
Comments
If call is retried and still fails, what error should be returned? The first error? last error? or an AggregateError? |
Scratch that. Re-using the same message ID makes no sense after losing a connection, as the repetition of a message ID has no significance when sent over a new websocket connection. Further to that, re-using the same message ID within a single session is a violation of the spec and should trigger a "AttemptedReplayAttacks" security event if it should occur. The only time it would be appropriate to retry sending a message is if the websocket connection closes after sending the message, but before receiving a response. But even then, there's no good reason to want to re-use a message ID. |
After lengthy consideration, I think this feature may cause more harm than good, so I'm going to retire this idea for now.
|
It would be good to have an option to opaquely retry calls which fail due to connection-related errors.
Perhaps a call option
{maxRetries: 3}
and/or an option in the RPC client/server constructors to set a default.By default,
maxRetries
should probably be 0 since there's a chance that retries could have undesirable effects if the call has been handled.The text was updated successfully, but these errors were encountered: