Initial retries support - #114
Conversation
| /* c8 ignore next: exceptional case */ | ||
| : {}; | ||
|
|
||
| clonedData = structuredClone(data); |
There was a problem hiding this comment.
Is this structured clone so that user-registered handlers don't accidentally modify data? If so, that's reasonable, just wondering.
There was a problem hiding this comment.
That, and also so that it stays as the raw JSON response instead of running through the deserializer.
It's not a solution I'm very happy with though (structured clone isn't super performant and it isn't always even used here, and I plan to rectify it in a future release)
| // @public | ||
| export interface CommandOptions<Spec extends CommandOptionsSpec = Required<CommandOptionsSpec>> { | ||
| // (undocumented) | ||
| isSafelyRetryable?: boolean; |
There was a problem hiding this comment.
Do you imagine users will set isSafelyRetryable on every command they want to be able to retry? Or will isSafelyRetryable be set on commands like findOne() that are read only by default?
There was a problem hiding this comment.
isSafelyRetryable will be an option people can use to force-set a method as either idempotent or not; otherwise, each method will have its own default idempotency.
Btw retries are still a far-fetched idea in its early experimental stage, so I wouldn't pay them too much heed for the time being 🙂 there's a very rough brain-dump-like spec in our internal "yellow doc" which you should have access to if you want more information.
No description provided.